Semiconductor memory device for storing multivalued data

ABSTRACT

Data storage circuits are connected to the bit lines in a one-to-one correspondence. A write circuit writes the data on a first page into a plurality of first memory cells selected simultaneously by a word line. Thereafter, the write circuit writes the data on a second page into the plurality of first memory cell. Then, the write circuit writes the data on the first and second pages into second memory cells adjoining the first memory cells in the bit line direction.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a Continuation-in-Part application of Ser. No. 10/689,868 filedOct. 20, 2003 now U.S. Pat. No. 6,925,004 which is aContinuation-in-Part application of U.S. patent application Ser. No.10/358,643 filed Feb. 4, 2003 (which was issued as U.S. Pat. No.6,657,891 B1 on Dec. 2, 2003), the entire contents of which areincorporated herein by reference.

This application is based upon and claims the benefit of priority fromthe prior Japanese Patent Applications No. 2002-347797, filed Nov. 29,2002; No. 2003-402161, filed Dec. 1, 2003, the entire contents of bothof which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to a nonvolatile semiconductor memory devicecapable of storing, for example, 2 bits or more of data.

2. Description of the Related Art

A nonvolatile semiconductor memory device capable of storing mutivalueddata, such as a NAND flash memory using EEPROM, has been proposed (U.S.Pat. No. 6,178,115).

In a NAND flash memory where a plurality of cells are arranged in amatrix, all of or half of the cells arranged in the direction of row areselected simultaneously. Data is written into or read from the selectedcells in unison. Specifically, the selected cells are connected tocorresponding bit lines. A latch circuit for holding the write and readdata is connected to each bit line. Data is written or read by using thelatch circuit.

This type of nonvolatile semiconductor memory device has beenminiaturized so significantly that the spacing between adjacent cells inthe row direction and the column direction is very narrow. As thedistance between adjacent cells becomes shorter, the capacitance betweenthe floating gates of adjacent cells (FG-FG capacitance) becomes larger.This causes the following problem: the threshold voltage Vth of a cellwritten into previously varies according to the data in an adjacent cellwritten into later due to the FG-FG capacitance. In the case of amutivalued memory that stores a plurality of data (k bits) in a singlecell, it has a plurality of threshold voltages. Therefore, it isnecessary to control the distribution of a threshold voltage per datavery narrowly, which causes the following significant problem: thethreshold voltage varies according to the data in the adjacent cells.Therefore, a nonvolatile semiconductor memory device capable ofpreventing the threshold voltage from varying with the data in theadjacent cells has been demanded.

BRIEF SUMMARY OF THE INVENTION

According to a first aspect of the present invention, there is provideda semiconductor memory device comprising: a memory cell array configuredby arranging a plurality of memory cells in a matrix, each of which iscapable of having at least one of four threshold voltages and storingtwo bits of data; a plurality of bit lines connected to the plurality ofmemory cells arranged in the column direction; a plurality of word linesconnected to the plurality of memory cells arranged in the rowdirection; a flag cell which is selected at the same time when thememory cells are selected by each of the word lines; a plurality of datastorage circuits which are connected to the plurality of bit lines in aone-to-one correspondence and store data; a write circuit which writesdata on a first page into a plurality of first memory cells selectedsimultaneously by one of the word lines, then writes data on a secondpage into the plurality of first memory cells and, when the data on thesecond page is written, writes data into the flag cell simultaneouslyselected by the word line, and thereafter writes the data on the firstand second pages sequentially into a second memory cell adjacent to thefirst memory cells in the bit line direction.

According to a second aspect of the present invention, there is provideda semiconductor memory device comprising: a memory cell array configuredby arranging a plurality of memory cells in a matrix, each of which iscapable of having at least one of four threshold voltages and storingtwo bits of data; a plurality of bit lines connected to the plurality ofmemory cells arranged in the column direction; a plurality of word linesconnected to the plurality of memory cells arranged in the rowdirection; a plurality of data storage circuits which are connected tothe plurality of bit lines in a one-to-one correspondence and storedata; a write circuit which writes data on a first page into a first anda second memory cell adjoining in the bit line, then writes data on asecond page into the first memory cell, and thereafter writes the dataon the first page into a third memory cell adjacent to the second memorycells in the bit line direction.

According to a third aspect of the present invention, there is provideda semiconductor memory device comprising: a memory cell array configuredby arranging a plurality of memory cells in a matrix, each of which iscapable of having one of an 2^(n) (n is a natural number equal to 2 ormore) number of threshold voltages and storing an n number of bits ofdata; a plurality of bit lines connected to the plurality of memorycells arranged in the column direction; a plurality of word linesconnected to the plurality of memory cells arranged in the rowdirection; a first and a second flag cell which are selected at the sametime when the memory cells are selected by the word lines; a writecircuit which divides an n number of pages composed of an n number ofbits stored in a plurality of memory cells selected by one of the wordlines into a first and a second area and, when writing data into thefirst area on a k-th page (2<=k<=n), writes the data into also the firstflag cell and, when writing data into the second area on the k-th page,writes the data into also the second flag cell.

According to a fourth aspect of the present invention, there is provideda semiconductor memory device comprising: a memory cell array configuredby arranging a plurality of memory cells in a matrix, each of which iscapable of having one of an 2^(n) (n is a natural number equal to 2 ormore) number of threshold voltages and storing an n number of bits ofdata; a plurality of bit lines connected to the plurality of memorycells arranged in the column direction; a plurality of word linesconnected to the plurality of memory cells arranged in the rowdirection; an (n−1)×i number of flag cells which are selected at thesame time when the memory cells are selected by the word lines; a writecircuit which divides an n number of pages composed of an n number ofbits stored in a plurality of memory cells selected by one of the wordlines into an i number (i is a natural number) of areas and, whenwriting data into the first area on a k-th page (2<=k<=n), writes thedata into also the ((k−2)×i+1)-th flag cell and, when writing data intothe i-th area on the k-th page, writes the data into also the(k−1)×i)-th flag cell.

According to a fifth aspect of the present invention, there is provideda semiconductor memory device comprising: a memory cell array configuredby arranging a plurality of memory cells in a matrix, each of which iscapable of having one of an 2^(n) (n is a natural number equal to 2 ormore) number of threshold voltages and storing an n number of bits ofdata; a plurality of bit lines connected to the plurality of memorycells arranged in the column direction; a plurality of word linesconnected to the plurality of memory cells arranged in the rowdirection; an i number of flag cells which are selected at the same timewhen the memory cells are selected by the word lines; a write circuitwhich divides an n number of pages composed of an n number of bitsstored in a plurality of memory cells selected by one of the word linesinto an i number (i is a natural number) of areas and, when writing datainto the first area on a k-th page (2<=k<=n), writes the data into alsothe first flag cell and, when writing data into the i-th area on thek-th page, writes the data into also the i-th flag cell.

According to a sixth aspect of the present invention, there is provideda semiconductor memory device comprising: a memory cell array configuredby arranging a plurality of memory cells in a matrix, each of which iscapable of having one of an 2^(n) (n is a natural number equal to 2 ormore) number of threshold voltages and storing an n number of bits ofdata; a plurality of bit lines connected to the plurality of memorycells arranged in the column direction; a plurality of word linesconnected to the plurality of memory cells arranged in the rowdirection; first and second flag cells which are selected at the sametime when the memory cells are selected by the word lines; a writecircuit which writes data “k” into the first flag cell and writes data“k−1” into the second flag cell, when writing a k-th page dataconstituted by n bits into the memory cells selected by the word line.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING

FIGS. 1A, 1B, and 1C show the relationship between the data in a memorycell according to a first embodiment of the present invention and thethreshold voltages of the memory cell;

FIG. 2 shows a schematic configuration of a nonvolatile semiconductormemory device according to the present invention;

FIG. 3 is a circuit diagram showing the configuration of the memory cellarray and bit line control section shown in FIG. 2;

FIGS. 4A and 4B are sectional views of a memory cell and a selecttransistor, respectively;

FIG. 5 is a sectional view of a NAND cell in the memory cell array;

FIG. 6 is a circuit diagram of an example of the data storage circuitshown in FIG. 3;

FIG. 7 is a diagram to help explain the order in which data is writteninto a NAND cell;

FIG. 8 is a flowchart for the operation of programming a first page;

FIG. 9 is a flowchart for the operation of programming a second page;

FIGS. 10A and 10B show the relationship between each data cache and thedata in the memory cell;

FIG. 11 is a diagram to help explain the procedure for setting the datacaches;

FIG. 12 is a diagram to help explain the procedure for setting the datacaches;

FIG. 13 is a flowchart for the operation of reading the first page;

FIG. 14 is a flowchart for the operation of reading the second page;

FIG. 15 is a flowchart for a modification of the operation of readingthe second page;

FIG. 16 is a flowchart for the operation of reading the first pageaccording to a second embodiment of the present invention;

FIG. 17 is a diagram to help explain program operations according to athird embodiment of the present invention;

FIG. 18 is a concrete flowchart for a fourth write operation in FIG. 17;

FIG. 19 is a concrete flowchart for a fifth write operation in FIG. 17;

FIG. 20 is a concrete flowchart for a sixth write operation in FIG. 17;

FIG. 21 is a diagram to help explain write operations in a fourthembodiment of the present invention;

FIG. 22 is a flowchart for part of the operations in FIG. 21;

FIGS. 23A and 23B are flowcharts for the sequence of writing data by aconventional pass write method;

FIG. 24 shows an algorithm for the operation of writing data “1” appliedto a fifth embodiment of the present invention;

FIG. 25 shows the relationship between each data cache and the data inthe memory cell in the fifth embodiment;

FIG. 26 is a flowchart to help explain the order in which a second pageis written into in a sixth embodiment of the present invention;

FIGS. 27A and 27B show the relationship between each data cache and thedata in the memory cell in the sixth embodiment;

FIG. 28 is a flowchart to help explain the order in which a second pageis written into in a seventh embodiment of the present invention;

FIGS. 29A and 29B show the relationship between each data cache and thedata in the memory cell in the seventh embodiment;

FIGS. 30A, 30B, and 30C show the relationship between each data cacheand the data in the memory cell in the seventh embodiment;

FIGS. 31A and 31B show the relationship between each data cache and thedata in the memory cell in the seventh embodiment;

FIGS. 32A and 32B show the relationship between each data cache and thedata in the memory cell in the seventh embodiment;

FIGS. 33A and 33B show the relationship between each data cache and thedata in the memory cell in the seventh embodiment;

FIG. 34 is a circuit diagram of a memory cell array and a bit linecontrol circuit according to an eighth embodiment of the presentinvention;

FIGS. 35A, 35B, and 35C show the relationship between the data in amemory cell and the threshold voltages of the memory cell in the eighthembodiment;

FIGS. 36A and 36B show the relationship between the data in a memorycell and the threshold voltages of the memory cell in the eighthembodiment;

FIGS. 37A and 37B are diagrams to help explain the order in which datais written into a memory cell in the eighth embodiment;

FIG. 38 is a flowchart for the operation of programming a third page inthe eighth embodiment;

FIGS. 39A and 39B show the relationship between each data cache and thedata in the memory cell in the eighth embodiment;

FIGS. 40A and 40B show the relationship between each data cache and thedata in the memory cell in the eighth embodiment;

FIG. 41A is a flowchart for the operation of reading a first page in theeighth embodiment and

FIG. 41B is a flowchart for the operation of reading a second page;

FIG. 42 is a flowchart for the operation of reading a third page in theeighth embodiment;

FIGS. 43A, 43B, 44A, 44B, 45A, 45B and 46 show the relationship betweeneach data cache and the data in the memory cell in the ninth embodiment;

FIGS. 47A and 47B show the relationship between data of the memory celland the threshold voltages of the memory cell in ninth embodiment;

FIG. 48 shows a flowchart of the modification of the ninth embodiment;

FIG. 49 shows a diagram to help explain the order in which data iswritten into a NAND cell in the tenth embodiment;

FIG. 50 is a circuit diagram showing the configuration of the memorycell array and bit line control section in the eleventh embodiment;

FIG. 51 is a circuit diagram of the data storage circuit applied to theeleventh embodiment;

FIG. 52 is a diagram to explain the order in which data is written intoa NAND cell in the eleventh embodiment;

FIG. 53 is a diagram which shows modification of FIG. 52;

FIG. 54 is a circuit diagram showing the modification of FIG. 50;

FIGS. 55 and 56 are diagrams to explain the order in which 3 bits dataare written into a NAND cell;

FIG. 57 shows a diagram showing the configuration of the memory cellarray and bit line control section applied to the twelfth embodiment;

FIGS. 58A to 58D are flowcharts to explain an operation of the twelfthembodiment;

FIG. 59 is a circuit diagram showing the modification of the circuitdiagram shown in FIG. 3;

FIGS. 60A and 60B show the threshold voltages of the memory cell and theflag cell according to a thirteenth embodiment of the present invention;

FIGS. 61A and 61B show the threshold voltages of the flag cell accordingto a thirteenth embodiment of the present invention;

FIG. 62 shows a flowchart for the operation of reading a first page inthe thirteenth embodiment;

FIG. 63 shows a flowchart for the operation of reading a second page inthe thirteenth embodiment; and

FIG. 64 shows a schematic configuration of modification of thethirteenth embodiment.

DETAILED DESCRIPTION OF THE INVENTION

Hereinafter, referring to the accompanying drawings, embodiments of thepresent invention will be explained.

The principle of the present invention will be explained. In the presentinvention, before the next data is stored into a memory cell into which,for example, i bits of data have been stored, i or less bits of data arewritten into the adjacent memory cells beforehand. In writing the i orless bits of data, the threshold voltage is made lower than the originalthreshold voltage (or the actual threshold voltage in storing i bits ofdata). After the adjacent memory cells have been written into, writingis done to raise the threshold voltage of the memory cell. In the cellswhose threshold voltage has risen due to the FG-FG capacitance, thethreshold voltage does not change much in the writing. In the cellswhose threshold voltage has not risen much due to the FG-FG capacitance,the threshold voltage rises in the writing, with the result that thethreshold voltage reaches the original value. However, before and afterthe writing to raise the threshold voltage, it is unknown whether the ibits of data have the original threshold voltage or a lower voltage thanthat. To differentiate between them, a flag memory cell (or flag cell)is prepared. A read operation is carried out according to the data inthe flag cell.

In a NAND flash memory, all of or half of the cells arranged in the rowdirection are written into simultaneously. Therefore, a flag cell isprovided for each unit of writing.

(First Embodiment)

FIG. 2 shows a schematic configuration of a nonvolatile semiconductormemory device, such as a NAND flash memory for storing four values (ortwo bits), according to the present invention.

A memory cell array 1 includes a plurality of bit lines, a plurality ofword lines, and a common source line. In the memory cell array 1, memorycells composed of, for example, EEPROM cells capable of electricallyrewriting data are arranged in a matrix. A bit control circuit 2 forcontrolling the bit lines and a word line control circuit 6 areconnected to the memory cell array 1.

The bit line control circuit 2 includes a plurality of data storagecircuits and a flag data storage circuit as explained later. The bitline control circuit 2 reads the data from a memory cell in the memorycell array 1 via a bit line, senses the state of a memory cell in thememory cell array 1 via a bit line, or writes data into a memory cell inthe memory cell array 1 by applying a write control voltage to thememory cell via a bit line. A column decoder 3 and a data input/outputbuffer 4 are connected to the bit line control circuit 2. A data storagecircuit in the bit line control circuit 2 is selected by the columndecoder 3. The data in the memory cell read into a data storage circuitis outputted from a data input/output terminal 5 to the outside worldvia the data input/output buffer 4.

The write data externally inputted to the data input/output terminal 5is inputted via the data input/output buffer 4 to the data storagecircuit selected by the column decoder 3.

The word line control circuit 6 is connected to the memory cell array 1.The word line control circuit 6 selects a word line in the memory cellarray 1 and applies the necessary voltage for reading, writing, orerasing to the selected word line.

The memory cell array 1, bit line control circuit 2, column decoder 3,data input/output buffer 4, and word line control circuit 6, which areconnected to a control signal and control voltage generator circuit 7,are controlled by the control signal and control voltage generatorcircuit 7. The control signal and control voltage generator circuit 7,which is connected to a control signal input terminal 8, is controlledby a control signal externally inputted via the control signal inputterminal 8.

The bit line control circuit 2, column decoder 3, word line controlcircuit 6, and control signal and control voltage generator circuit 7constitute a write circuit and a read circuit.

FIG. 3 shows the configuration of the memory cell array 1 and the bitline control circuit 2 shown in FIG. 2. In the memory cell array 1, aplurality of NAND cells is provided. A NAND is composed of a memory cellmade up of, for example, 16 EEPROMs connected in series, and selectgates S1, S2. The first select gate S1 is connected to bit line BL0 andthe second select gate S2 is connected to source line SRC. The controlgates of the memory cells arranged in each row are connected in commonto word lines WL2, WL2, WL3, . . . , WL16. The first select gate S1 isconnected in common to select line SG1 and the second select gate S2 isconnected in common to select line SG2.

The memory cell array 1 includes a plurality of blocks as shown by abroken line. Each block is composed of a plurality of NAND cells. Datais erased in blocks. An erase operation is carried out simultaneously ontwo bit lines connected to a data storage circuit 10 and a flag datastorage circuit 10 a.

The bit line control circuit 2 has a plurality of data storage circuits10 and a flag data storage circuit 10 a. Pairs of bit lines (BL0, BL1),(BL2, BL3), . . . , (BLi, Bli+1), (BL, BL) are connected to theindividual data storage circuits 10 and flag data storage circuit 10 ain a one-to-one correspondence.

A plurality of memory cells (the memory cells enclosed by a broken line)provided for every other bit line and connected to a word lineconstitutes one sector. Data is written and read in sectors. In onesector, for example, two pages of data are stored. A flag cell FC forstoring a flag is connected to each word line. That is, in the firstembodiment, one sector includes one flag cell FC.

The number of flag cells FC is not limited to one for one sector. Asshown by the broken line, a plurality of flag cells may be connected toone sector. In this case, as explained later, the data stored in theflag cells has only to be determined by a majority decision.

In a read operation, a program verity operation, and a programoperation, of the two bit lines (BLi, BLi+1) connected to the datastorage circuit 10, one bit line is selected according to the addresssignal (YA, YA2, . . . , YAi, YAFlag) externally specified. In addition,according to an external address, one word line is selected and onesector (for two pages) is selected. The switching between two pages isdone according to an address.

FIGS. 4A and 4B are sectional views of a memory cell and a selecttransistor. FIG. 4A shows a memory cell. In a substrate 41, n-typediffused layers 42 serving as the source and drain of a memory cell areformed. Above the substrate 41, a floating gate (FG) 44 is formed via agate insulating film 43. Above the floating gate 44, a control gate (CG)46 is formed via an insulating film 45. FIG. 4B shows a select gate. Ina substrate 41, n-type diffused layers 47 acting as the source and drainare formed. Above the substrate 41, a control gate 49 is formed via agate insulating film 48.

FIG. 5 is a sectional view of a NAND cell in the memory cell array. Inthis example, a NAND cell is composed of 16 memory cells MC with theconfiguration of FIG. 4A connected in series. On the drain side andsource side of the NAND cell, a first select gate S1 and a second selectgate S2 with the configuration of FIG. 4B are provided.

FIG. 6 is a circuit diagram of the data storage circuit 10 shown in FIG.3. The flag data storage circuit 10 a has the same configuration as thatof the data storage circuit 10.

The data storage circuit 10 includes a primary data cache (PDC), asecondary data cache (SDC), a dynamic data cache (DDC), and a temporarydata cache (TDC). The SDC, PDC, DDC hold the input data in a writeoperation, the read data in a read operation, or the data temporarily ina verify operation, and are used to manipulate the internal data instoring mutivalued data. The TDC amplifies the data on the bit line andholds the data temporarily when reading the data and is used tomanipulate the internal data when storing the manipulated data.

The SDC is composed of clocked inverter circuits 61 a, 61 b constitutinga latch circuit and transistors 61 c, 61 d. The transistor 61 c isinserted between the input terminal of the clocked inverter circuit 61 aand the input terminal of the clocked inverter circuit 61 b. Signal EQ2is supplied to the gate of the transistor 61 c. The transistor 61 d isconnected between the output terminal of the clocked inverter circuit 61b and the ground. Signal PRST is supplied to the gate of the transistor61 d. Node N2 a of the SDC is connected to an input/output data line IOnvia a column select transistor 61 e. Node N2 b is connected to aninput/output data line IO via a column select transistor 61 f. Columnselect signal CSLi is supplied to the gates of the transistors 61 e, 61f. Node N2 a of the SDC is connected to Node N1 a of the PDC viatransistors 61 g, 61 h. Signal BLC2 is supplied to the gate of thetransistor 61 g and signal BLC1 is supplied to the gate of thetransistor 61 h.

The PDC is composed of clocked inverter circuits 61 i, 61 j and atransistor 61 k. The transistor 61 k is connected between the inputterminal of the clocked inverter circuit 61 i and the input terminal ofthe clocked inverter circuit 61 j. Signal EQ1 is supplied to the gate ofthe transistor 61 k. Node N1 b of the PDC is connected to the gate of atransistor 61 l. One end of the current path of the transistor 61 l isconnected to the ground via a transistor 61 m. Signal CHK1 is suppliedto the gate of the transistor 61 m. The other end of the current path ofthe transistor 61 l is connected to one end of the current path oftransistors 61 n, 61 o constituting a transfer gate. Signal CHK2 n issupplied to the gate of the transistor 61 n. The gate of the transistor61 o is connected to the junction node of the transistors 61 g and 61 h.Signal COMi is supplied to the other end of the current path of thetransistors 61 n, 61 o. The signal COMi, which is a signal common to allof the data storage circuits 10, indicates whether all of the datastorage circuits 10 have been verified. That is, as described later,after they have been verified, node N1 b of the PDC goes low. In thisstate, when signal CHK1 and signal CHK2 are made high, signal COMi goeshigh, if all of the data storage circuits 10 have been verified.

The TDC is composed of, for example, a MOS capacitor 61 p. The capacitor61 p is connected between junction node N3 of the transistors 61 g, 61 hand the ground. The DDC is connected via a transistor 61 q to junctionnode N3. Signal REG is supplied to the gate of the transistor 61 q.

The DDC is composed of transistors 61 r, 61 s. Signal VREG is suppliedto one end of the current path the transistor 61 r. The other end of thecurrent path of the transistor 61 r is connected to the current path ofthe transistor 61 q. The gate of the transistor 61 r is connected via atransistor 61 s to node N1 a of the PDC. Signal DTG is supplied to thegate of the transistor 61 s.

One end of the current path of transistors 61 t, 61 u is connected tothe junction node N3. Signal VPRE is supplied to the other end of thecurrent path of the transistor 61 u. Signal BLPRE is supplied to thegate of the transistor 61 u. Signal BLCLAMP is supplied to the gate ofthe transistor 61 t. The other end of the current path of the transistor61 t is connected via a transistor 61 v to one end of a bit line BLo andalso connected via a transistor 61 w to one end of a bit line BLe. Theother end of the bit line BLo is connected to one end of the currentpath of a transistor 61 x. Signal BlASo is supplied to the gate of thetransistor 61 x. The other end of the bit line BLe is connected to oneend of the current path of a transistor 61 y. Signal Blasé is suppliedto the gate of the transistor 61 y. Signal BLCRL is supplied to theother end of the current path of the transistors 61 x, 61 y. Thetransistors 61 x, 61 y, which are turned on complementarily withtransistors 61 v, 61 w according to signals BlASo, BlASe, supply thepotential of the signal BLCRL to the unselected bit lines.

The above signals and voltages are generated by the control signal andcontrol voltage generator circuit 7 shown in FIG. 2. The followingoperations are controlled by the control signal and control voltagegenerator circuit 7.

The memory, which is a mutivalued memory, is capable of storing 2 bitsof data in a cell. The switching between the 2 bits is effected by anaddress (a first page, second page).

(Explanation of Operation)

The operation in the above configuration will be explained.

FIG. 1 shows the relationship between the data in a memory cell and thethreshold voltages of the memory cell. After an erase operation iscarried out, the data in a memory cell becomes “0”. As shown in FIG. 1A,after a first page is written into, the data in the memory cell becomedata “0” and data “2”. As shown in FIG. 1B, before a second page iswritten into, data equal to or lower than the threshold of the actualdata is written into the adjacent cells. Then, the data written intothe-cells makes the distribution of the threshold voltage of data “2”larger. Thereafter, when data has been written into the second page, thedata in the memory cell become data “0” to “3” with the originalthreshold voltage as shown in FIG. 1C. The data in the memory cell aredefined in ascending order of threshold voltage.

FIG. 7 shows the order in which NAND cells are written into. In a block,a write operation is carried out in pages, starting with the memory cellclosest to the source line. In FIG. 7, for the sake of explanation, thenumber of word lines is assumed to be four.

In a first write operation, one bit of data is written into a first pageof memory cell 1.

In a second write operation, one bit of data is written into the firstpage of memory cell 2 adjacent to memory cell 1 in the direction ofword.

In a third write operation, one bit of data is written into the firstpage of memory cell 3 adjacent to memory cell 1 in the direction of bit.

In a fourth write operation, one bit of data is written into the firstpage of memory cell 4 adjacent to memory cell 1 in a diagonal direction.

In a fifth write operation, one bit of data is written into a secondpage of memory cell 1.

In a sixth write operation, one bit of data is written into the secondpage of memory cell 2 adjacent to memory cell 1 in the direction ofword.

In a seventh write operation, one bit of data is written into the firstpage of memory cell 5 adjacent to memory cell 3 in the direction of bit.

In an eighth write operation, one bit of data is written into the firstpage of memory cell 6 adjacent to memory cell 3 in a diagonal direction.

In a ninth write operation, one bit of data is written into the secondpage of memory cell 3.

In a tenth write operation, one bit of data is written into the secondpage of memory cell 4 adjacent to memory cell 3 in the direction ofword.

In an eleventh write operation, one bit of data is written into thefirst page of memory cell 7 adjacent to memory cell 5 in the directionof bit.

In a twelfth write operation, one bit of data is written into the firstpage of memory cell 8 adjacent to memory cell 5 in a diagonal direction.

In a thirteenth write operation, one bit of data is written into thesecond page of memory cell 5.

In a fourteenth write operation, one bit of data is written into thesecond page of memory cell 6 adjacent to memory cell 5 in the directionof word.

In a fifteenth write operation, one bit of data is written into thesecond page of memory cell 7.

In a sixteenth write operation, one bit of data is written into thesecond page of memory cell 8 adjacent to memory cell 7 in the directionof word.

(Program and Program Verify)

(First Page Program)

FIG. 8 shows a flowchart for programming the first page. In a programoperation, an address is first specified to select two pages (onesector) shown in FIG. 3. In the memory, of the two pages, a programoperation can be carried out only in this order: the first page, thesecond page. Therefore, the first page is first selected by an address.

Next, the inputted write data is stored in the SDC (shown in FIG. 6) ineach of the data storage circuits 10 (ST1). After a write command isinputted, the data in the SDCs in all of the data storage circuits 10are transferred to the PDC (ST2). That is, signals BLC1, BLC2 are set toa specific voltage, for example, Vdd+Vth (Vdd: power supply voltage(e.g., 3V or 1.8V, to which they are not restricted, Vth: the thresholdvoltage of an n-channel MOS transistor), thereby turning on thetransistors 61 h, 61 g. Then, the data on node N2 a is transferred viathe transistors 61 g, 61 h to the PDC. Therefore, when data “1” (to dono-writing) is inputted from the outside world, node N1 a of the PDCgoes high. When data “0” (to do writing) is inputted, node N1 a of thePDC goes low. Hereinafter, let the data in the PDC be the potential ofnode N1 a and the data in the SDC be the potential of node N2 a.

In programming the first page, no data is written into the flag cell. Asa result, the PDC in the flag data storage circuit 10 a has data “1”(program operation) (ST13).

The potentials of signal BLC1, signal BLCLAMP, and signal BLSo or BLSeshown in FIG. 6 are set to Vd+Vth. Then, the transistors 61 h, 61 t, and61 v or 61 w turn on, causing the data held in the PDC to be supplied tothe bit line. When data “1” (to do no writing) has been stored in thePDC, the bit line is at Vdd. When data “0” (to do writing), the bit lineis at Vss (the ground potential). The cells in the unselected page (withits bit line unselected) connected to the selected word line must not bewritten into. For this reason, Vdd is also supplied to the bit linesconnected to these cells as when data “1” has been stored. Here, Vdd isapplied to the select line SG1 of the selected block, potential VPGM(20V) is applied to the selected word line, and potential VPASS (10V) isapplied to the unselected word lines. Then, when the bit line is at Vss,writing is effected because the channel of the cell is at Vss and theword line is at VPGM. On the other hand, when the bit line is at Vdd,the channel of the cell is not at Vss. Raising the VPGM causes VPGM/2 tobe produced by coupling. This prevents the cell from being programmed.

When data “0” is written, the data in the memory cell is made “2” asshown in FIG. 1. When data “1” is written, the data in the memory cellis kept at “0” (first page verify) (S14).

In a program verify operation, a potential a little higher than thepotential in a read operation is applied to the selected word line.Hereinafter, a potential marked with “′” is assumed to indicate a verifypotential a little higher than the read potential.

In the first page verify operation, verifying is done by applying apotential of “b*′” lower than the potential “b′” of the word line (shownin FIG. 1C) in an actual verify operation as shown in FIG. 1A.Hereinafter, “*” indicates a potential lower than the actual value and“*′” indicates a verify potential lower than the verify potential lowerthan the actual value.

First, a read potential Vread is applied to the unselected word linesand select line SG1 in the selected block. For example, Vdd+Vth issupplied as signal BLPRE to the data storage circuit 10, a specificvoltage, for example, 1V+Vth, is supplied as BLCLAMP, and signal VPRE isset to Vdd. Under these condition, the bit line is precharged at 1V.

Next, select line SG2 on the source side of the cell is made high. Thecells whose threshold voltage is higher than the potential “b*′” turnoff. As a result, the bit line remains high. The cells whose thresholdvoltage is lower than the potential “b*′” turn on. As a result, the bitline is at Vss. While the bit line is being discharged, the TDC is setto VSS, with VPRE equal to VSS and BLPRE at the high level. Thereafter,signal REG is set to Vdd+Vth and VREG is set to Vdd, thereby turning onthe transistor 61 q, which causes the data in the DDC to the TDC.

Next, signal DTG is set to Vdd+Vth, thereby turning on the transistor 61s temporarily, which causes the data in the PDC to the DDC. That is, thetransferred data is held as the gate potential of the transistor 61 r.

Thereafter, signal BLC1 is set to, for example, Vdd+Vth, thereby turningon the transistor 61 h, which causes the data in the TDC to the PDC.

Next, signal BLPRE is set to a specific voltage, for example, Vdd+Vth,thereby meeting the equation VPRE=Vdd, which precharges node N3 of theTDC at Vdd. Thereafter, signal BLCLAMP is set to, for example, 0.9V+Vth,thereby turning on the transistor 61 t. When the bit line is at the lowlevel, node N3 of the TDC is at the low level. When the bit line is atthe high level, node N3 of the TDC is at the high level.

Here, when writing is done, the low level is stored in the DDC of FIG.6. When no writing is done, the high level is stored in the DDC.Therefore, with signal VREG at Vdd and signal REG at the high level,node N3 of the TDC is forced to be high only when no writing is done.After this operation, the data in the PDC is moved to the DDC and thepotential of the TDC is transferred to the PDC. The high level signal islatched in the PDC only when the cell is not written into and when data“2” has been written into the cell and the threshold voltage of the cellhas reached the verify potential “b*”. The low level signal is latchedin the PDC only when the threshold voltage of the cell has not reached“b*”.

When the PDC is at the low level, the write operation is carried outagain and the program operation and verify operation are repeated untilthe data in all of the data storage circuits 10 have become high (S15 toS13). The above operations are identical with those in the case oftwo-valued data.

(Adjacent Cell Program)

As shown in FIG. 7, after one bit of data has been written into thefirst page of memory cell 1, the first page of memory cell 2 adjacent tomemory cell 1 in the direction of word is written into, the first pageof memory cell 3 adjacent to memory cell 1 in the direction of bit iswritten into, and the first page of memory cell 4 adjacent to memorycell 1 in a diagonal direction is written into in that order. Afterthese write operations have been carried out, the threshold voltage ofmemory cell 1 may rise due to the FG-FG capacitance, depending on thewritten data. As a result, the distribution of the threshold voltages ofdata “0” and data “2” in memory cell 1 expands toward higher potentialsas shown in FIG. 1B.

Thereafter, in the fifth write operation, one bit of data is writteninto the second page of memory cell 1.

(Second Page Program)

FIG. 9 is a flowchart for the operation of programming (or writing datainto) the second page. In the second page programming operation, too,two pages shown in FIG. 3 are selected.

Next, the inputted write data is stored in the SDC in each of all thedata storage circuits (S21). When data “1” (to do no writing) isinputted, node N2 a of the SDC of the data storage circuit 10 goes high.When data “0” (to do writing) is inputted, node N2 a of the SDC goeslow.

Thereafter, when a write command is inputted, data “0” is inputted tothe SDC in the flag cell data storage circuit 10 a to write data intothe flag cell, because the second page is to be programmed (S22). Asdescribed earlier, more than one flag cell may be provided to increasethe reliability. In this case, data “0” is inputted to the flag cells ofthe second page.

In programming the second page, when the data in the memory cell is “0”and the input data is “1”, the data in the memory cell is kept at “0”.When the input data is “0”, the data in the memory cell is kept at “1”.

When the data in the memory cell is “2” and the input data is “0”, thedata in the memory cell is kept at “2”. However, after the first page iswritten into, the verify potential “b*′” lower than the usual value isused in verifying whether the data in the memory cell has reached “2”.Therefore, the memory cell is written into until the original verifypotential “b′” has been reached.

When the data in the memory cell is “2” and the input data is “1”, thedata in the memory cell is set to “3”.

(Internal Data Read)

First, before the cell is written into, an internal read operation iscarried out to determine whether the data in the memory cell of thefirst page is “0” or “2” (S23). An internal data read operation isidentical with a read operation. In determining whether the data in anordinary memory cell is “0” or “2”, a read potential of “b” is appliedto the selected word line. Since the verify potential is written only to“b*′” lower than the ordinary level in the first page programmingoperation, it may be lower than the potential “b”. Therefore, in theinternal data read, a read operation is carried out by supplying apotential of “a” to the word line.

Specifically, a potential Vread is applied to the unselected word linesand select line SG1 in the selected block. At the same time, signal VPREis set to Vdd and signals BLPRE and signal BLCLAMP are set to a specificvoltage, for example, 1V+Vth. Under these conditions, the bit line isprecharged at Vdd. Thereafter, select line SG2 on the source side of thecell is made high. Since the cells whose threshold voltage is higherthan the potential “a” turn off, the bit line remains high. In addition,since the cells whose threshold voltage is lower than the potential “a”turn on, the bit line is discharged and has the ground potential Vss.

Next, signal VPRE of the data storage circuit 10 is set to Vdd andsignal BLPRE is set to Vdd+Vth, thereby precharging node N3 of the TDCat Vdd. Thereafter, signal BLCLAMP is set to, for example, 0.9V+Vth.When the bit line is at the low level, node N3 of the TDC is at the lowlevel. When the bit line is at the high level, node N3 of the TDC is atthe high level. Thereafter, the potential of the TDC is transferred tothe PDC. As a result, when the data in the memory cell is “2”, or when ahigh level signal is latched in the PDC and the data in the memory cellis “0”, a low level signal is latched in the PDC. FIG. 10A shows therelationship between the data in the memory cells in the SDC and PDCafter a data load operation and an internal read operation.

(Setting Data Caches) (S24)

Thereafter, the data stored in each data cache is manipulated accordingto the procedure for data cache setting shown in FIGS. 11 and 12.

As a result of such manipulation, the data stored in each data cache isas shown in FIG. 10B.

Specifically, when the data in the memory cell is made “0” (data “1” inthe first page and data “1” in the second page), the PDC is set to thehigh level, the DDC is set to the low level, and the SDC is set to thehigh level.

When the data in the memory cell is made “1” (data “1” in the first pageand data “0” in the second page), the PDC is set to the low level, theDDC is set to the high level, and the SDC is set to the high level.

When the data in the memory cell is made “2” (data “0” in the first pageand data “0” in the second page), the PDC is set to the low level, theDDC is set to the high level, and the SDC is set to the low level.

When the data in the memory cell is made “3” (data “0” in the first pageand data “1” in the second page), the PDC is set to the low level, theDDC is set to the low level, and the SDC is set to the low level.

(Second Page Verify: Verifies Memory Cell Data “2”) (S25)

A cell into which data “2” is to be written is written into with theverify potential “b*′” lower than the original-verify potential “b′” ofthe first page. Thereafter, the threshold voltage may have risen as aresult of the adjacent cells being written into and therefore some cellsmay have reached the original verify potential “b′”. For this reason,data “2” is first verified. In the program verify operation, thepotential “b′” a little higher than the read potential “b” is applied tothe selected word line.

First, a potential Vread is applied to the unselected word lines andselect line SG1 in the selected block. Then, signal BLCLAMP of the datastorage circuit 10 of FIG. 6 is set to 1V+Vth and signal REG is set toVdd+Vth. Under these conditions, the bit line is precharged. When date“0” and data “3” are written into the memory cell, the DDC has been setto the low level as shown in FIG. 10B. As a result, the bit line isprevented from being precharged. When date “1” and data “2” are writteninto the memory cell, the DDC has been set to the high level. As aresult, the bit line is precharged.

Next, select line SG2 on the source side of the NAND cell is made high.The cells whose threshold voltage is higher than the potential “b′” turnoff. As a result, the bit line remains high. The cells whose thresholdvoltage is lower than the potential “b′” turn on. As a result, the bitline is at Vss. While the bit line is being discharged, node N3 of theTDC is set to Vss temporarily. Thereafter, signal REG is made high,thereby turning on the transistor 61 q, which causes the data in the DDCto be transferred to the TDC.

Next, signal DTG is set to Vdd+Vth, thereby turning on the transistor 61s temporarily, which causes the data in the PDC to be transferred to theDDC. Thereafter, the data in the TDC is moved to the PDC.

Next, signal VPRE is set to Vdd and signal BLPRE is set to Vdd+Vth,thereby precharging node N3 of the TDC at Vdd. Thereafter, signalBLCLAMP is set to 0.9V+Vth, thereby turning on the transistor 61 t. Whenthe bit line is at the low level, node N3 of the TDC is at the lowlevel. When the bit line is at the high level, node N3 of the TDC is atthe high level.

Here, when writing is done, the low level signal is stored in the DDC.When writing is not done, the high level is stored in the DDC.Therefore, with signal VREG at Vdd and signal REG at Vdd+Vth, node N3 ofthe TDC is forced to be high only when no writing is done.

Thereafter, the data in the PDC is moved to the DDC and the potential ofthe TDC is read into the PDC. The high level signal is latched in thePDC only when no writing is done, and when data “2” has been writteninto the cell and the threshold voltage of the cell has reached theverify potential “b′”. The low level signal is latched in the PDC onlywhen the threshold voltage of the cell has not reached “b′” and whendata “1” and data “3” have been written in the memory cell.

(Program Operation) (S26)

A program operation is identical with the first page program operation.When data “1” has been stored in the PDC, no writing is done. When data“0” has been stored in the PDC, writing is done.

(Second Page Verity: Verifies Memory Cell Data “1”) (S27)

In the program verify operation, a potential of “a′” a little higherthan the read potential “a” is applied to the selected word line.

First, a read potential Vread is applied to the unselected word linesand select line SG1 in the selected block. Signal BLCLAMP of the datastorage circuit 10 is set to 1V+Vth and BLC2 is set to Vdd+Vth. Underthese conditions, the bit line is precharged. When data “2” and data “3”are written into the memory cell, the data stored in the SDC is “0”. Asa result, the bit line is prevented from being precharged. Only whendata “0” and data “1” are written into the memory cell, the bit line isprecharged.

Next, select line SG2 on the source side of the cell is made high. Sincethe cells whose threshold voltage is higher than the potential “a′” turnoff, the bit line remains high. In addition, since the cells whosethreshold voltage is lower than the potential “a′” turn on, the bit lineis at Vss. While the bit line is being discharged, node N3 of the TDC isset to Vss temporarily and signal REG is made high, thereby turningon-the transistor 61 q, which causes the data in the DDC to betransferred to the TDC.

Next, signal DTG is made high, thereby turning on the transistor 61 stemporarily, which causes the data in the PDC to be transferred the DDC.Thereafter, the data in the TDC is transferred to the PDC. Next, signalBLPRE of the data storage circuit is set to the voltage Vdd+Vth, therebyturning on the transistor 61 u, which precharges node N3 of the TDC atVdd. Thereafter, signal BLCAMP is set to 0.9V+Vth, thereby turning onthe transistor 61 t. Then, when the bit line is at the low level, nodeN3 of the TDC is at the low level. When the bit line is at the highlevel, node N3 of the TDC is at the high level.

Here, when writing is done, the low level has been stored in the DDC.When writing is not done, the high level has been stored in the DDC.Therefore, with signal VREG at Vdd and signal REG at the high level,node N3 of the TDC is forced to be high only when no writing is done.After this operation, the data in the PDC is transferred to the DDC andthe potential of the TDC is read into the PDC. The high level is latchedin the PDC only when the cell is not written into and when data “1” hasbeen written into the cell and the threshold voltage of the cell hasreached the verify potential “a′”. The low level is latched in the PDConly when the threshold voltage of the cell has not reached “a′” andwhen data “2” and data “3” have been written into the memory cell.

(Second Page Verify: Verifies Memory Cell Data “2”) (S28)

Like the verification of memory cell data “2” before programming, memorycell data “2” is verified.

(Second Page Verify: Verifies Memory Cell Data “3”) (S29)

In this program verify operation, a potential of “c′” a little higherthan the read potential “c” is applied to the selected word line asshown in FIG. 1C. In this state, a read potential Vread is first appliedto the unselected word lines and select line SG1 in the selected block.Signal BLCLAMP is set to 1V+Vth and signal BLPRE is set to Vdd+Vth,thereby turning on transistors 61 t, 61 u, which precharges the bitline.

Next, select line SG2 on the source side of the cell is made high. Sincethe cells whose threshold voltage is higher than the potential “c′” turnoff, the bit line remains high. In addition, since the cells whosethreshold voltage is lower than the potential “c′” turn on, the bit lineis at Vss. While the bit line is being discharged, node N3 of the TDC isset to Vss and signal REG is made high, thereby turning on thetransistor 61 q, which causes the data in the DDC to be transferred tothe TDC.

Next, signal DTG is made high, thereby turning on the transistor 61 s,which causes the data in the PDC to be transferred the DDC. Thereafter,the data in the TDC is transferred to the PDC. Next, signal BLPRE is setto the voltage Vdd+Vth, thereby turning on the transistor 61 u, whichprecharges node N3 of the TDC at Vdd. Thereafter, signal BLCAMP is setto 0.9V+Vth, thereby turning on the transistor 61 t. Then, when the bitline is at the low level, node N3 of the TDC is at the low level. Whenthe bit line is at the high level, node N3 of the TDC is at the highlevel.

Here, when writing is done, the low level has been stored in the DDC.When writing is not done, the high level has been stored in the DDC.Therefore, signal VREG is set to Vdd and signal REG is set to the highlevel, thereby turning on the transistor 61 q. Then, node N3 of the TDCis forced to be high only when no writing is done. After this operation,the data in the PDC is transferred to the DDC and the potential of theTDC is read into the PDC. The high level is latched in the PDC only whenthe cell is not written into and when data “3” has been written into thememory cell and the threshold voltage of the cell has reached the verifypotential “c′”. The low level is latched in the PDC only when thethreshold voltage of the cell has not reached “c′” and when data “1” anddata “2” have been written into the memory cell.

When the PDC is at the low level, the write operation is carried outagain and the program operation and verify operation are repeated untilthe data in the PDC of all of the data storage circuits have become high(S30).

In the first embodiment, after the first programming, three verifyoperations have been carried out. In the initial program loop, thethreshold voltage does not rise. Therefore, the verification of memorycell data “3” or the verification of memory cell data “3” and theverification of memory cell data “2” may be omitted. In a program loopclose to the end, the writing of memory cell data “1” or the writing ofmemory cell data “2” and memory cell data “1” has been completed.Therefore, these verify operations may be omitted. If the verificationof memory cell data “1” is not needed, it is not necessary for the SDCto store the data. Thus, the data for writing the next data may be readfrom the outside world.

Furthermore, no data has been written into the flag cell on the firstpage. Only on the second page, the data has been written into the flagcell. As a result, the data in the flag cell has been “1”.

(First Page Read)

FIG. 13 is a flowchart for the operation of reading the first page.First, an address is specified to select two pages shown in FIG. 3. Asshown in FIGS. 1B and 1C, the distribution of the threshold voltagechanges before and after the writing of the second page. Therefore,after the potential of the word line is set to “a”, a read operation iscarried out and it is determined whether the data in the flag cell is“0” or “1”) (S31, S32). In this determination, if more than one flagcell is used, whether the data is “0” or “1” is determined by a majoritydecision.

When the data read from the flag cell is “1” (or the data in the memorycell is “0”), the writing of the second page has not been carried out.As a result, the distribution of the threshold voltage of the cell is asshown in FIG. 1A or 1B. To determine the data in such a cell, a readoperation has to be carried out with the potential of the word line at“a”. In step S31, however, the result of the read operation with theword line potential “a” has been already read into the data storagecircuit. Therefore, the data stored in the data storage circuit isoutputted (S33).

On the other hand, when the data read from the flag cell is “0” (or thedata in the memory cell is “1”), the writing of the second page has beencarried out. As a result, the distribution of the threshold voltage ofthe cell is as shown in FIG. 1C. To determine the data in such a cell, aread operation has to be carried out with the potential of the word lineat “b”. Thus, a read operation is carried out with the word linepotential at “b” (S34). Thereafter, the data read into the data storagecircuit is outputted (S33).

(Read Operation: First Page Read)

As described above, in the first page read operation, a read operationis carried out, with the read potential “a” or “b” being applied to theselected word line.

First, a read potential Vread is supplied to the unselected word linesand select line SG1 in the selected block. Signal BLPRE of the datastorage circuit of FIG. 6 is set to 1V+Vth and signal BLCLAMP is set toVdd+Vth. Under these conditions, the bit line is precharged. Thereafter,select line SG2 on the source side of the cell is made high. Since thecells whose threshold voltage is higher than the potential “a” or “b”turn off, the bit line remains high. In addition, since the cells whosethreshold voltage is lower than the potential “a” or “b” turn on, thebit line is at Vss.

Next, signal BLPRE of the data storage circuit is set to the voltageVdd+Vth, thereby turning on the transistor 61 u, which precharges nodeN3 of the TDC at Vdd. Thereafter, signal BLCAMP is set to 0.9V+Vth,thereby turning on the transistor 61 t. Then, when the bit line is atthe low level, node N3 of the TDC is at the low level. When the bit lineis at the high level, node N3 of the TDC is at the high level.Thereafter, the data in the PDC is transferred to the SDC.

(Second Page Read)

FIG. 14 is a flowchart for the operation of reading the second page. Ina second page read operation, an address is first specified to selecttwo pages shown in FIG. 3. As shown in FIGS. 1B and 1C, the distributionof the threshold voltage changes before and after the writing of thesecond page. After the writing of the second page, the distribution isas shown in FIG. 1C. Therefore, a read operation is first carried out,with the potential of the word line set at “c” (S35). Thereafter, theword line potential is set to “a” and then a read operation is carriedout (S36). When the threshold voltage of the cell is lower than “a” orhigher than the word line potential “c”, the data is determined to be“1”. When the threshold voltage of the cell is higher than “a” or lowerthan the word line potential “c”, the data is determined to be “0”.Before the writing of the second page, the data on the second pageshould be outputted as “1”. However, the threshold voltage distributionis as shown in FIG. 1A. As a result, when the same read operation asafter the writing of the second page is carried out, the output datamight be “0”. Therefore, it is determined whether the data in the flagcell is “0” or “1” (S37). As a result, when the data in the flag cell is“1” and the writing of the second page has not been carried out, theoutput data is fixed to “1” (S38). To output “1”, signal PRST of thedata storage circuit is made high and “1” is set in the SDC.Alternatively, the data input/output buffer shown in FIG. 2 is caused tooutput only data “1”. In addition, when the data in the flag cell is“0”, the read-out data is outputted (S39).

FIG. 15 shows a modification of the second page read operation. In thiscase, the potential of the word line is set to “a” and the data in theflag cell is read. Then, the data in the flag cell is determined (S40,S41). When the data in the flag cell is “1”, the writing of the secondpage has not been carried out. Thus, the output data is fixed to “1”(S42). When the data in the flag cell is “0”, the writing of the secondpage has been carried out. Thus, the potential of the word line is setto “c” and a read operation is carried out. Then, the read-out data isoutputted (S43, S44). With this configuration, too, the read operationof the second page can be carried out.

However, in the first embodiment, the potential of the word line isfirst set to “c” and a read operation is carried out as shown in FIG.14. Thereafter, the potential of the word line is set to “a” and a readoperation is carried out. When the data in the flag cell is “0”, thedata read into the data storage circuit is outputted. When the data inthe flag cell is “1”, the writing of the second page has not beencarried out. Thus, when the data is outputted to the outside world, thedata in the data storage circuit is not outputted, but data “1” isalways outputted.

Specifically, in reading the second page, the following operation willbe carried out.

(Read Operation: a First Second Page Read)

In a first read operation of the second page, the read potential “c” issupplied to the selected word line and a read operation is carried out(S35). The read operation, which is identical with the above-describedfirst page read, stores the read-out cell data into the PDC.

(Read Operation: a Second Page Read Operation).

In a second read operation of the second page, the read potential “a” issupplied to the selected word line and a read operation is carried out(S36).

First, a read potential Vread is supplied to the unselected word linesand select line SG1 in the selected block. In this state, signal BLPREof the data storage circuit and signal BLCLAMP are set to 1V+Vth. Underthese conditions, the bit line is precharged. Thereafter, select lineSG2 on the source side of the cell is made high. Since the cells whosethreshold voltage is higher than the potential “a” turn off, the bitline remains high. In addition, since the cells whose threshold voltageis lower than the potential “a” turn on, the bit line is at Vss.

Next, signal BLPRE of the data storage circuit is set to the voltageVdd+Vth, thereby precharging node N3 of the TDC at Vdd. Thereafter,signal BLCAMP is set to Vdd+Vth, thereby turning on the transistor 61 t.Then, when the bit line is at the low level, node N3 of the TDC is atthe low level. When the bit line is at the high level, node N3 of theTDC is at the high level. Thereafter, the DTG is made high, the REG ismade high, and the VREG is made low. Then, only when the PDC is high,node N3 of the TDC is at the low level. After this operation, the datain the PDC is transferred to the SDC. As a result, when the thresholdvoltage of the cell is lower than the potential “a” or higher than thepotential “c”, the output data becomes “1”. When the threshold voltageof the cell is higher than the potential “a” or lower than the potential“c”, the output data becomes “0”.

(Erase)

In an erase operation, an address is first specified to select the blockenclosed by a broken line in FIG. 3. After the erase operation, the datain the memory cell becomes “0”. Even when a read operation is carriedout on any one of the first, second, and third pages, data “1” isoutputted.

In the first embodiment, the data on the first page is written into thememory cell with a potential lower than the original threshold voltage.Before the data on the second page is written, the data on the firstpage is written into the adjacent memory cells. After the adjacent cellsare written into, the data on the second page is written into the memorycell, thereby setting the original threshold voltage corresponding tothe stored data. Because the data on the first page is written into thememory cell, taking into the effect of the FG-FG capacitance of theadjacent memory cells, it is possible to set the threshold voltagecorresponding to the mutivalued data accurately.

Furthermore, when the data on the second page is written, or when thedata is written into the flag cell and the data is read from each page,the output data is controlled according to the data stored in the flagcell. Therefore, it is possible to output the data on each pagereliably.

(Second Embodiment)

FIG. 16 shows a second embodiment of the present invention obtained bymodifying the first embodiment. In the first embodiment, when the secondpage is written, the memory cell data in the flag cell is changed from“0” to “1”. However, the memory cell data in the flag cell may bechanged from “0” to “2”. With this configuration, the operation ofreading the first page can be modified as shown in FIG. 16.

First, the potential of the word line is set to “b” and a read operationis carried out to determine the data in the flag cell (S45, S46). Whendata has been written in the flag cell, the data stored in the datastorage circuit is outputted as it is (S47). When no data has beenwritten in the flag cell, the potential of the word line is set to “a”and a read operation is carried out (S48). This causes the read-out datato be outputted (S47).

With the second embodiment, when the second page is written, memory celldata “2” is written into the flag cell. This enables the data to be readout in one cycle-in reading the data on the first page in the memorycell selected together with the flag cell into which memory cell data“2” has been written. Therefore, the number of reads can be decreased,which enables a high-speed reading.

When the second page is written into, the data in the memory cellchanges only from data “0” to data “1,” or from data “2” to data “3.”However, when the second page is written into, the data in the flag cellis caused to change from data “0” to data “2,” the distribution of thethreshold voltages of the memory cells adjacent to the flag cell getswider. To prevent this, for example, a dummy bit line and memory cellare provided between the flag cell and the memory cell.

In FIG. 59, a pair of dummy bit lines DMBL and dummy cells DMCconstituting a NAND cell are provided between a flag cell FC and bitline Li+1 and a plurality of memory cells connected to the bit line. Thepair of dummy bit lines DMBL are connected to a dummy data storagecircuit 10 b. An address signal YAD1 is supplied to the dummy datastorage circuit 10 b. This configuration prevents the distribution ofthe threshold voltages of the memory cells from getting wider due to theinfluence of the flag cell being written into.

Furthermore, as shown in FIG. 59, the pair of dummy bit lines DMBL andthe dummy cells DMC may be provided between the flag cell FC and aredundancy cell array RD. The pair of dummy bit lines DMBL are connectedto a dummy data storage circuit 10 c. An address signal YAD2 is suppliedto the dummy data storage circuit 10 c. This configuration prevents thedistribution of the threshold voltages of the redundancy cells fromgetting wider due to the flag cell being written into.

(Third Embodiment)

FIG. 17 is a diagram to help explain program operations according to athird embodiment of the present invention.

In the first and second embodiments, data “1”, data “2”, and data “3”are written simultaneously into a memory cell in writing the secondpage. In the third embodiment, however, only data “2” is written intothe memory cell first. After the writing is completed, data “1” and data“3” are written simultaneously into the memory cell. A write operationin the third embodiment is executed as follows.

A first write: the first page is written into a first memory cell (S51).

A second write: the first page is written into a second memory cell(S52).

A third write: the first page is written into a third memory cell (S53).

A fourth write: the first page is written into a fourth memory cell(S54). Thereafter, before the data for a fifth write is loaded, data “2”is written into the first memory cell and second memory cell with theoriginal threshold voltage in that order (S55, S56).

A fifth write: the second page is written into the first memory cell(S57).

A sixth write: the second page is written into the second memory cell(S58).

A seventh write: the first page is written into a fifth memory cell(S59).

An eighth write: the first page is written into a sixth memory cell(S60). Thereafter, before the data for a ninth write is loaded, data “2”is written into the third memory cell and fourth memory cell with theoriginal threshold voltage in that order (S61, S62).

FIG. 18 is a concrete flowchart for the fourth write operation. FIG. 19is a concrete flowchart for the fifth write operation. FIG. 20 is aconcrete flowchart for the sixth write operation.

In FIG. 18, the operation of writing the first page into the fourthmemory cell is the same as the operation shown in FIG. 8. Thereafter,data “2” is written into the first memory cell with the originalthreshold voltage. Specifically, the voltage of the word line is set to“a” and the data is read from the memory cell (S55-1). According to theread-out data, the TDC, DDC, and PDC are set (S55-2). Thereafter, theoriginal threshold voltage “b” of data “2” is supplied to the word linefor verification (S55-3). Then, a program operation is carried out,thereby changing the threshold voltage of the memory cell (S55-4). Then,the threshold voltage of the memory cell is verified with the thresholdvoltage “b′” (S55-5). The program operation and verify operation arerepeated until all of the PDCs have taken the value of “1” (S55-6 toS55-4)

Thereafter, data “2” is written into the second memory cell with theoriginal threshold voltage in the same manner as writing the data intothe first memory (S56-1 to S56-6).

The operation of writing the second page into the first memory cell inFIG. 19 (S57-1 to S57-8) differs from the operation of writing thesecond page in the first embodiment of FIG. 9 in the following point. InFIG. 9, after the data cache setting, the data in the memory cell isverified with the threshold voltage “b′”. In contrast, in a writeoperation shown in FIG. 19, since data “2” has been already written, averify operation with the threshold voltage “b′” is omitted. Therefore,after the data cache setting, the second page is programmed into thefirst memory (S57-4, S57-5). Even in a verify operation after theprogram operation, a verify operation with threshold voltage “b′” isomitted. Therefore, only verify operations with the threshold voltages“a′” and “c′” are carried out (S57-6, S57-7).

Because the operation of writing the second page into the second memorycell shown in FIG. 20 is the same as writing the second page into thefirst memory cell shown in FIG. 19, its explanation is omitted.

In the third embodiment, after the first page is written, data “2” iswritten with original threshold voltage before the second page iswritten. Consequently, although the programming time for the second pageis longer than that for the first page in the first embodiment, theprogramming time for the first page can be made almost equal to that forthe second page in the third embodiment.

(Fourth Embodiment)

FIGS. 21 and 22 show a fourth embodiment of the present inventionobtained by modifying the third embodiment. Write operations in thefourth embodiment are executed as shown in FIG. 21.

A first write: the first page is written into a first memory cell (S71).

A second write: the first page is written into a second memory cell(S72).

A third write: the first page is written into a third memory cell (S73).Thereafter, data “2” is written into the first memory with the originalthreshold voltage (S74).

A fourth write: the first page is written into a fourth memory cell(S75). Thereafter, data “2” is written into the second memory with theoriginal threshold voltage (S76).

A fifth write: the second page is written into the first memory cell(S77).

A sixth write: the second page is written into the second memory cell(S78).

A seventh write: the first page is written into a fifth memory cell(S79). Thereafter, data “2” is written into the third memory with theoriginal threshold voltage (S80).

An eighth write: the first page is written into a sixth memory cell(S81). Thereafter, data “2” is written into the fourth memory with theoriginal threshold voltage (S82).

FIG. 22 is a flowchart to help explain the third write operationconcretely.

Because the operation of writing the first page into the third memorycell (S73) and the operation of writing data “2” into the first memorycell with the original threshold voltage (S74) shown in FIG. 22 are thesame as the operation of writing the first page into the fourth memorycell (S54) and the operation of writing data “2” into the first memorycell with the original threshold voltage (S55) shown in FIG. 18,explanation of them is omitted.

Furthermore, the operation of writing the second page into the firstmemory cell (S77) is the same as the writing operation shown in FIG. 19.

In the fourth embodiment, after the first page is written, data “2” iswritten with the original threshold voltage before the second page iswritten. Therefore, like the third embodiment, the fourth embodimentenables the programming time for the first page to be almost equal tothat for the second page.

(Fifth Embodiment)

In recent years, a pass write method has been proposed to narrow thedistribution of the threshold voltage in a write operation of amutivalued flash memory that store a plurality of bits.

FIG. 23 shows a write sequence in a conventional pass write method.

In a first program sequence of the first page write (see FIG. 23A) andthe second page write (see FIG. 23B) by the pass write method, thethreshold voltage of the memory cell is set to the verify potentials“a*′” and “b*′” lower than the original threshold voltage and a writeand a verify operation for the first page are carried out. After theprogram verify has passed, the verify potential is set to the originalvoltages “a′”, “b′”, and “c′” and a write and a verify operation for thefirst page are carried out in the second page program sequence of thefirst page write and the second page write. In the pass write method, acell once written into is written into again until its threshold voltagehas risen a little. The degree of variability of the threshold voltagein rewriting becomes smaller. As a result, the threshold voltagedistribution becomes smaller.

Generally, in a NAND flash memory, half of the cells connected to thesame word line are written into simultaneously. For this reason, in thefirst verification of a write verify loop, there are many cells whosethreshold voltage is lower and therefore a lot of current flows into thesource line, which brings the source line into a floating state. As aresult, the threshold voltage of the cell first written into isdetermined in this state. Thereafter, when another cell has been writteninto, the potential of the source line returns from the floating state.Consequently, the threshold voltage of the cell first written intoapparently gets lower, causing the problem of spreading the thresholdvoltage distribution. In the pass write method, however, the thresholdvoltage can be prevented from spreading.

Generally, a write voltage of Vpgm is increased by ΔVpgm each time aprogram verify operation is carried out. In the pass write method, thewrite voltage ΔVpgm in a first write is increased in, for example, 0.4Vsteps. After the first write sequence is completed, the write voltageVpgm is returned to the initial voltage value. In a second write, too,the write voltage Vpgm is increased by ΔVpgm each time a program verifyoperation is carried out. The second write voltage, however, isincreased by a lower voltage than the first write voltage ΔVpgm, forexample, in 0.2V steps. Under these conditions, a write operation iscarried out. By setting the write voltage this way, high-speed writingcan be done.

In the first to fourth embodiments, when data “2” and data “3” arewritten into a memory cell, data “2” is written into the memory cell inwriting the first page with the threshold voltage “b*′” lower than theoriginal threshold voltage “b′”. Thereafter, the second page is writtenwith the threshold voltage “b′” and threshold voltage “c′”. Therefore,the pass write is also carried out.

In the conventional pass write method of FIG. 23, there are twosequences in writing the first page: a first write verify for thethreshold voltage “a*′” and a second write verify for the thresholdvoltage “a′”. In addition, there are two sequences in writing the secondpage: a first write verify for the threshold voltage “b*” and a secondwrite verify for the threshold voltages “a*” and “c*′”.

In the first to fourth embodiments, however, there are only a writeverify for the threshold voltage “b*′” in writing the first page and awrite verify for the threshold voltages “b′” and “c′” in writing thesecond page. Therefore, when data “1” is written into a memory cell, thepass write is not carried out. Thus, in the fifth embodiment, the secondpage is written into using the following algorithm.

FIG. 24 shows an algorithm for writing data “1” applied to the fifthembodiment.

First, data caches SDC, DDC, and TDC are set as shown in FIG. 25. Inthis state, a verify potential of “a*′” lower than the originalthreshold voltage is set and a write operation is carried out on thebasis of the data in the PDC (S90 to S95). The program is verifiedrepeatedly until all of the PDCs have become high (S94 to S96).Thereafter, as shown in FIG. 10B, the data caches are set (S97) and awrite operation is carried out to set the verify potential to theoriginal threshold voltage “a′”. The second write operation is carriedout at the same time writing is done with the threshold voltage “b′” andthe threshold voltage “c′”. The program is verified repeatedly until allof the PDCs have become high (S98 to S104).

In the fifth embodiment, since the pass write method can be applied evento the writing of memory cell data “1”, all of the data can be writtenby the pass write method.

(Sixth Embodiment)

FIG. 26 shows a sixth embodiment of the present invention obtained bymodifying the fifth embodiment. Specifically, In the sixth embodiment,the sequence of writing the second page is changed. As shown in FIG.27A, after the data caches are set, a write operation is carried out toreach the verify potential “a*′” lower than the original voltage, thethreshold voltage “b′”, and the threshold voltage “c′”. The program andverify operations are repeated until all of the PDCs have become high(S110 to S119). Thereafter, the data in the SDC is inverted as shown inFIG. 27B. Then, the resulting data is transferred to the PDC (S120).Thereafter, the verify potential for the cell with data “1” is set tothe original threshold voltage “a′” and writing is done. The program andverify operations are repeated until all of the PDCs have become high(S121 to S124).

Therefore, the sixth embodiment also produces the same effect as that ofthe fifth embodiment.

(Seventh Embodiment)

FIGS. 28 and 29 show a seventh embodiment of the present inventionobtained by modifying the fifth embodiment. In the fifth embodiment,writing is done to reach the verify potential “a*′” in writing thesecond page. Thereafter, a write operation with the verify potential“a′” and write operations with the threshold voltage “b′” and thethreshold voltage “c′” are carried out simultaneously.

In the seventh embodiment, however, an intermediate potential issupplied to the bit line in a write operation and data is written intothe cells whose threshold voltage has exceeded the verify potential“a*′”. By doing this, the degree of variability of the threshold voltagein writing is made smaller, thereby making the threshold voltagedistribution smaller.

FIG. 28 shows the sequence of writing in the seventh embodiment. FIGS.29A to 33B show the workings of the data caches.

(a) The data inputted from the outside world is stored in the SDC andthe data read by an internal data read is stored in the PDC (S131 toS134, FIG. 29).

(b) The data caches are set as shown in FIG. 29B.

(c) With VREG=Vdd and REG=Vsg, when DDC=1, the bit line is precharged atVdd. When DDC is at “0”, the bit line is not precharged (FIG. 30A).

(d) With BLC1=intermediate potential+Vth (=2V+Vth) (Vclamp), when thePDC is at “0”, the bit line is at Vss. When the PDC has “1” andprecharging has been done, the bit line remains unchanged. If it is hasnot been precharged, the bit line is at an intermediate potential (2V)(FIG. 30B).

Here, with the selected word line at Vpgm and the unselected word lineat Vpass, when the bit line is at Vdd, no writing is done. When the bitline is at Vss, writing is done. When the bit line is at an intermediatepotential (2V), writing is done a little (S135).

(e) After the write operation is completed, while the word line issetting up, the data in the PDC is transferred to the DDC. Then, thedata in the DDC is inverted and the resulting data is transferred to thePDC (see FIG. 30C).

(f) As shown in FIG. 31A, in an operation with the verify potential “a′”(S136), with BLC1 being high (e.g., Vdd+Vth) and BLCLAMP being at aspecific potential, for example, 1V+Vth, only when the PDC is at “1”(that is, when data “1” has been written into the memory cell), the bitline is precharged. When the PDC is at “0”, the bit line is notprecharged (or remains at Vss). Next, the potential of the word line isset to the verify potential “a*′”, thereby discharging the bit line.While the bit line is being discharged, the data in the PDC is inverted.

(g) With VPRE=Vdd and BLPRE=Vsg, the TDC is charged at Vdd. Thereafter,signal BLCLAMP is set to 0.9V+Vth, thereby turning on transistor 61 t.When the bit line is at Vss, the TDC is at Vss. When the prechargepotential is left on the bit line, the TDC is at Vdd. It is when data“1” has been written into the memory cell and the threshold voltage hasreached the verify potential “a*′” that the TDC is at Vdd. When data “1”has not been written into the memory cell, the bit line has not beenprecharged, with the result that the TDC is at Vss. The TDC is also atVss when data “1” has been written into the memory cell and thethreshold voltage has not reached the verify potential “a*′”.

Here, with VREG being high and REG being high, when the data in the DDCis at “1”, the TDC is forced to be high. Therefore, it is when data “1”has been written into the memory cell and the threshold voltage hasreached the verify potential “a*′” or when a write operation has notbeen selected that the TDC is at Vdd. Thereafter, with DTG=Vsg, the datain the PDC is copied into the DDC. Thereafter, with BLC1=Vsg, the PDCtakes in the potential of the TDC (see FIG. 31B).

(h) Next, the potential of the word line is lowered a little to producethe verify potential “a”, thereby discharging the bit line (see FIG.32A).

Thereafter, with VPRE=Vdd and BLPRE=Vsg, the TDC is charged again atVdd. Then, signal BLCLAMP is set to 0.9V+Vth, thereby turning on thetransistor 61 t. When the bit line is at Vss, the TDC is at Vss. Whenthe precharge potential is left on the bit line, the TDC is at Vdd. Itis when data “1” has been written into the memory cell and the verifypotential “a′” has been reached that the TDC is at Vdd. When data “1”has not been written into the memory cell, the bit line has not beenprecharged. Thus, the TDC is at Vss. The TDC is also at Vss when data“1” has been written into the memory cell and the threshold voltage hasnot reached the verify potential “a′”.

Here, with VREG being high and REG being high, when the data in the DDCis “1” (or when data “1” has not been written into the memory cell), theTDC is forced to be high. Thus, it is when data “1” has not been writteninto the memory cell or when data “1” has been written into the memorycell and the threshold voltage has reached the verify potential “a′”that the TDC is at Vdd.

Thereafter, with DTG=Vsg, the data in the PDC is copied into the DDC.Then, with BLC1=Vsg, the PDC takes in the potential of the TDC.

(i) The data in the DDC is transferred to the PDC. Then, the data in thePDC is transferred to the DDC (see FIG. 32B).

(j) In a memory cell into which data “1” has been written, after all ofthe writing with the verify potential “a*′” is completed, the data inthe PDC becomes “1” (see FIG. 33A).

(k) In a memory cell into which data “1” has been written, after all ofthe writing with the verify potential “a′” is completed, all of the datain the DDCs become “1” (see FIG. 33B).

(l) In an operation with the verify potential “b′” (see FIG. 28, S137),BLC2 is made high (e.g., Vdd+Vth) and a specific potential, for example,1V+Vth, is supplied as BLCLAMP. Then, only when the SDC is at “1” (thatis, when data “1” or data “2” has been written into the memory cell),the bit line is precharged. When the SDC is at “0”, the bit line is notprecharged (or remains at Vss).

Next, the verify potential “b′” is supplied to the word line and the bitline is discharged. While the bit line is being discharged, the data inthe DDC is transferred to the TDC. Then, the data in the PDC istransferred to the DDC. The data in the TDC is then transferred to thePDC. Thereafter, the TDC is charged at Vdd. Then, a specific potential,for example, 0.9V+Vth, is supplied as BLCLAMP. It is only when data “2”has been written into the memory cell and the threshold voltage hasreached the verify potential “b′” that the TDC becomes high. With VREGbeing high and REG being at Vsg, when the data in the DDC is at the highlevel, the TDC is forced to be high. Therefore, it is when data “2” hasbeen written into the memory cell and the threshold voltage has reachedthe verify potential “b′” or when a write operation has not beenselected that the TDC is at Vdd. Thereafter, with DTG=Vsg, the data inthe PDC is copied into the DDC. Then, with BLC1=Vsg, the PDC takes inthe potential of the TDC.

(m) In an operation with the verify potential “c′” (see FIG. 28, S138),BLPRE is made high (e.g., Vdd+Vth) and a specific potential, forexample, 1V+Vth, is supplied as BLCLAMP. Under these conditions, the bitline is precharged. Next, the verify potential “c′” is supplied to theword line and the bit line is discharged. While the bit line is beingdischarged, the data in the DDC is transferred to the TDC. Then, thedata in the PDC is transferred to the DDC. The data in the TDC is thentransferred to the PDC. Thereafter, the TDC is charged at Vdd. Then, aspecific potential, for example, 0.9V+Vth, is supplied as BLCLAMP. It isonly when the threshold voltage of the memory cell has reached theverify potential “c′” that the TDC becomes high. With VREG being highand REG being at Vsg, when the data in the DDC is at the high level, theTDC is forced to be high. Therefore, it is when data “3” has beenwritten into the memory cell and the threshold voltage has reached theverify potential “c′” or when a write operation has not been selectedthat the TDC is at Vdd. Thereafter, with DTG=Vsg, the data in the PDC iscopied into the DDC. Then, with BLC1=Vsg, the PDC takes in the potentialof the TDC.

In this way, the program and verify operations are repeated until all ofthe data in the PDC and the DDC have become “1” (S139).

In the seventh embodiment, a cell whose threshold voltage has exceededthe verify potential “a*′” is written into in a write operation bysupplying an intermediate potential to the bit line. Therefore, thedegree of variability in a write operation can be made smaller andtherefore the threshold voltage distribution can be made smaller. As aresult, a high-speed write operation can be carried out.

(Eighth Embodiment)

FIG. 34 shows a memory cell array 1 and a bit line control circuit 2 ina NAND flash memory for storing eight-valued (3-bit) data according toan eighth embodiment of the present invention. Because the configurationof FIG. 34 is almost the same as the four-valued (2-bit) configurationof FIG. 3, what differs from the latter will be explained.

In FIG. 34, when one word line is selected according to an externaladdress, one sector shown by a broken line is selected. One sector iscomposed of three pages. The three pages are switched according to anaddress. That is, since 3-bit data can be stored in a memory cell, threebits are switched according to an address (a first page, a second, page,or a third page). One sector has two flag cells FC1, FC2. Therefore,when one word line is selected, two flag cells FC1, FC2 are selectedsimultaneously. The flag cells FC1, FC2 are connected via bit lines toflag data storage circuits 10 a, 10 b, respectively. The flag cell FC1stores the fact that the second page has been written. The flag cell FC2stores the fact that the third page has been written.

However, since one cell can store 3-bit data, one flag cell may storethe fact that the second page and third page have been written, insteadof using the two flag cells.

Furthermore, to increase the reliability, a plurality of flag cells FC1and FC2 may be provided. In this case, the same data is stored in theseflag cells, and the data read from the flag cells is determined by amajority decision in a read operation.

The operation of the eighth embodiment will be explained.

The erase operation is the same as in the case of four-valued data.

FIGS. 35 and 36 show the relationship between the data in a memory celland the threshold voltages of the memory cell. After an erase operationis carried out, the data in the memory cell becomes “0” as shown in FIG.35A. After a first page is written, the data in the memory cell becomedata “0” and data “4” (FIG. 35B). After a second page is written, thedata in the memory cell become “0”, “2”, “4”, and “6” (FIGS. 35C and36A). After a third page is written, the data in the memory cell becomedata “0” to data “7” (FIG. 36B). In the eighth embodiment, the data inthe memory cell are defined in ascending order of threshold voltage.

FIGS. 37A and 37B show two write sequences in the eighth embodiment. Ina block, a write operation is carried out in pages, starting with thememory cell closest to the source line. In FIGS. 37A and 37B, for thesake of explanation, the number of word lines is assumed to be four. Thewrite sequence shown in FIG. 37A is similar to that shown in FIG. 7. Incontrast, the write sequence shown in FIG. 37B differs a little fromthat shown in FIG. 37A. Specifically, after the first page is written,up to the second page is written into the same cells, instead of writingthe second page into the adjacent cells. Thereafter, before the thirdpage is written, up to the second page is written into the adjacentcells. Then, the third page is written. In this way, writing may bedone, taking into account the effect of the adjacent cells on the thirdpage.

It is assumed that the original read potentials of word lines of thethird page are “a”, “b”, “c ”, “d”, “e”, “f”, and “g” and the verifypotentials are “a′”, “b′”, “c′”, “d′”, “e′”, “g′”, and “g′”. It isassumed that the read potentials of the second page are “b*” (=“a”),“d*”, and “f*” lower than the original read potentials and the verifypotentials of the second page are “b*′”, “d*′”, and “f*′” a little lowerthan these potentials. The verify potential of the first page is apotential of “d**” (=“a”) lower than the original read potential and theverify potential of the first page is a potential of “d**′” a littlehigher than the verify potential of the first page.

(Program and Program Verify)

In a program operation, an address is first specified to select threepages shown in FIG. 34. In the memory, of the three pages, a programoperation can be carried out only in this order: the first page, thesecond page, the third page. Therefore, the first page and second pageprograms are the same as in the case of four-valued data.

The data in a four-valued memory cell and the threshold voltages of thememory cell shown in FIGS. 35A to 35C correspond to FIGS. 1A to 1C. Theprogram and program verify flowcharts are the same as those in FIGS. 8and 9, so they are omitted. Here, the data in the memory cell aredefined as “0”, “1”, “2”, and “3” and the potentials of the word lineare “a”, “b”, and “c” in the case of four-valued data, whereas the datain the memory cell are defined as “0”, “2”, “4”, and “6” and thepotentials of the word line are “b”, “d”, and “f” in the case ofeight-valued data.

(First Page Program)

The flowchart diagram for the first page program is the same as in FIG.8 except that the definition of the word line potentials are changed asdescribed above.

(Adjacent Cell Program)

As shown in FIG. 37A, after one bit of data is written into the firstpage of memory cell 1, the first page of memory cell 2 adjacent tomemory cell 1 in the direction of word is written into. Then, the firstpage of memory cell 3 adjacent to memory cell 1 in the direction of bitis written into and the first page of memory cell 4 adjacent to memorycell 1 in a diagonal direction is written into. After these writeoperations have been carried out, the threshold voltage of memory cell 1rises due to the FG-FG capacitance, depending on the written data. As aresult, the distribution of the threshold voltages of data “0” and data“4” in memory cell 1 expands toward higher threshold voltages as shownin FIG. 35B.

Thereafter, one bit of data is written into the second page of memorycell 1.

(Second Page Program)

The flowchart for the second page program is the same as the flowchartfor writing by the pass write method in FIG. 9 expect that thedefinition of the word line potentials is changed. The data in the datacaches after a data load and an internal read and the data in the datacaches after the data caches are set are the same as those in FIGS. 10Aand 10B. Data is written into the first flag cell FC1.

(Adjacent Cell Program)

As shown in FIG. 37A, after data is written into the first and secondpages of memory cell 1, data is written into the second page of memorycell 2, the first pages of memory cells 5 and 6, and the second page ofmemory cells 3 and 4. After these write operations have been carriedout, the threshold voltage of memory cell 1 rises due to the FG-FGcapacitance, depending on the written data. As a result, thedistribution of the threshold voltages of data “2”, data “4”, and data“6” in memory cell 1 expands as shown in FIG. 36A.

Thereafter, one bit of data is written into the third page of memorycell 1.

(Third Page Program)

FIG. 38 is a flowchart for programming the third page. In the operationof programming the third page, an address is first specified to selectthree pages shown in FIG. 34.

Next, the write data is inputted from the outside world and stored inthe SDCs of all the data storage circuits (S141). When data “1” (to dono writing) is inputted, the SDC of the data storage circuit 10 shown inFIG. 6 goes high. When data “0” (to do writing) is inputted, the SDCgoes low. Thereafter, when a write command is inputted, because thethird page is to be programmed, data “0” is inputted to the SDCs in theflag cell data storage circuits 10 a, 10 b to write data into the flagcell FC2.

In programming the third page, as shown in FIG. 36B, with the data inthe memory cell being “0”, the data in the memory cell is kept at “0”when the input data is “1”, whereas the data in the memory cell is made“1” when the input data is “0”.

With the data in the memory cell being “2”, when the input data is “0”,the data in the memory cell is kept at “2”. However, in writing thesecond page, the verify potential “b*′” lower than the original value isused when it is verified whether the data in the memory cell has reached“2”. For this reason, a memory cell in which data “2” has been stored iswritten into until a potential of “b′”, the original verify potential,has been reached. With the data in the memory cell being “2”, when thedata inputted from the outside world is “1”, the data in the memory cellis made “3”.

With the data in the memory cell being “4”, when the input data is “1”,the data in the memory cell is kept at “4”. However, in writing thesecond page, the verify potential “d*′” lower than the original value isused when it is verified whether the data in the memory cell has reached“4”. For this reason, a memory cell in which data “4” has been stored iswritten into until a potential of “d′”, the original verify potential,has been reached. With the data in the memory cell being “4”, when theinput data is “0”, the data in the memory cell is made “5”.

With the data in the memory cell being “6”, when the input data is “0”,the data in the memory cell is kept at “6”. However, in writing thesecond page, the verify potential “f*′” lower than the original value isused when it is verified whether the data in the memory cell has reached“6”. For this reason, a memory cell in which data “6” has been stored iswritten into until a potential of “f′”, the original verify potential,has been reached. With the data in the memory cell being “6”, when theinput data is “1”, the data in the memory cell is made “7”.

(First Third Page Programming)

In programming the third page, data “1” to data “7” are written into thememory cell.

Although these data items can be programmed simultaneously, four dataitems, data “4” to data “7” are first written into the memory cell inthe eighth embodiment. In programming by the pass write method, a memorycell into which data “1” is to be written has not been written at all.For this reason, a memory cell into which data “1” is to be written iswritten into roughly. Thereafter, memory cell data “1” to memory celldata “3” are written. Hereinafter, a concrete explanation will be given.

(Internal Data Read 1 and Data Cache Setting 1) (S142 to S144)

Before the cells are written into, it is determined whether the data inthe memory cell of the second page is “4” or “6” or is “0” or “2”, orwhether the data in the memory cell is “6” or not or the data is any oneof “0”, “2”, and “4”. To do this, the potential of the word line is setto “d*” and “f*” in that order, thereby carrying out an internal readoperation (S142, S143).

FIG. 39A shows the state of the data caches after an internal read.Thereafter, by manipulating the data caches, the data caches are set asshown in FIG. 39B (S144).

In FIG. 39B, when the data in the memory cell is made “0” to “3”, thePDC is set high. When the data in the memory cell is made “4”, the PDCis set low, the DDC is set low, and the SDC is set high. When the datain the memory cell is made “5”, the PDC is set low, the DDC is set high,and the SDC is set high. When the data in the memory cell is made “6”,the PDC is set low, the DDC is set high, and the SDC is set low. Whenthe data in the memory cell is made “7”, each of the PDC, DDC, and SDCis set low.

(Third Page Verify: Verifies Data “4”) (S145)

In a memory cell into which data “4” is to be written, writing is doneon the second page until the verify potential “d*′” lower than theoriginal verify potential “d′” has been reached. Thereafter, thethreshold voltage of the cell into which data “4” has been written mayhave risen as a result of writing the adjacent cells. In addition, theremay be cells whose verify potential has reached the original verifypotential “d′”. For this reason, data “4” is first verified.

In a program verify operation to determine whether the threshold voltageof the memory cell has reached data “4”, a potential of “d′” a littlehigher than the read potential “d” is supplied to the selected wordline.

First, a read potential Vread is supplied to the unselected word linesand select line SG1 in the selected block. In this state, signal BLCLAMPof the data storage circuit 10 shown in FIG. 6 is set to, for example,1V+Vth and signal BLC2 is set to a specific voltage, for example,Vdd+Vth. Under these conditions, the bit line is precharged. As aresult, the bit line is prevented from being precharged, when data “7”and data “6” are written into the memory cell. Only when data “0” todata “5” are written into the memory cell, the bit line is precharged.

Next, with signal VREG being at Vss and signal REG being high, when data“6” and data “5” are written into the memory cell, the prechargedpotential becomes Vss. That is, it is only when data “0”, data “3”, anddata “4” are written into the memory cell that the bit line isprecharged. Next, select line SG2 on the source side of the cell is madehigh. Since the cells whose threshold voltage is higher than “d′” turnoff, the bit line remains high. In addition, since the cells whosethreshold voltage is lower than “d′” turn on, the bit line is at Vss.While the bit line is being discharged, node N3 of the TDC is set to Vsstemporarily and signal REG is made high, thereby turning on thetransistor 61 q, which causes the data in the DDC to be transferred tothe TDC. Then, the DTG is turned on temporarily, causing the data in thePDC to be transferred to the DDC. Thereafter, the data in the TDC istransferred to the PDC.

Next, signal BLPRE is set to a specific voltage, for example, Vdd+Vth,thereby precharging node N3 of the TDC at Vdd. Thereafter, signalBLCLAMP is set to 0.9V+Vth, thereby turning on the transistor 61 t. Whenthe bit line is at the low level, node N3 of the TDC is at the lowlevel. When the bit line is at the high level, node N3 of the TDC is atthe high level. Here, when writing is done, the low level has beenstored in the DDC. When no writing is done, the high level has beenstored in the DDC. Therefore, when signal VREG is set to Vdd and signalREG is made high, the node of the TDC is forced to be high only when nowriting is done. After this operation, the data in the PDC istransferred to the DDC and the potential of the TDC is read into thePDC. It is only when no writing is done or when data “4” has beenwritten into the memory cell and the threshold voltage of the cell hasreached the threshold voltage “d” that the high level is latched in thePDC. It is when the threshold voltage of the cell has not reached “d′”or when data “7”, “6”, and “5” have been written into the memory cellthat the low level is latched in the PDC.

(Third Page Verify: Verifies Memory Data “6”) (S146)

In a memory cell into which data “6” is to be written, writing is doneon the second page until the verify potential “f*′” lower than theoriginal verify potential “f′” has been reached. Thereafter, thethreshold voltage may have risen as a result of writing the adjacentcells. In addition, there may be cells whose verify potential hasreached the original verify potential “f′”. For this reason, data “6” isfirst verified.

The operation of verifying data “6” is identical with the operation ofverifying data “4” in writing the second page (data “2” in writing thesecond page in the first to seventh embodiments). Here, the verifypotential is “f′”.

(Program Operation) (S147)

The program operation is identical with the program operations for thefirst and second pages. Specifically, when data “1” has been stored inthe PDC, no writing is done. When data “0” has been stored in the PDC,writing is done. Thereafter, data “4” to data “7” are verified. Sincethe operations of verifying data “4” and data “6” (S148, S150) are thesame as those in S145 and S146, explanation of them is omitted.

(Third Page Verify: Verifies Memory Cell Data “5”) (149)

The operation of verifying data “5” is identical with the operation ofverifying data “2” in writing the second page (data “1” in writing thesecond page in the first to seventh embodiments). Here, the verifypotential is “e′”.

(Third Page Verify: Verifies Memory Cell Data “7”) (151)

The operation of verifying data “7” is identical with the operation ofverifying data “6” in writing the second page (data “3” in writing thesecond page in the first to seventh embodiments). Here, the verifypotential is “g′”.

When the PDC is low, the write operation is carried out again and theprogram operation and the verify operation are repeated until the datain the PDCs of all of the data storage circuits have become high (S152).

In the above explanation, after one programming is completed, fourverify operations are carried out. In the initial loop of theprogramming, the threshold voltage of the memory cell does not rise.Therefore, the operations of verifying data “7”, of verifying data “7”and data “6”, and of verifying data “7”, data “6”, and data “5” may beomitted.

Furthermore, in a loop close to the end of the programming, theoperations of verifying data “4”, of verifying data “4” and data “5”,and of verifying data “4”, data “5”, and data “6” may be omitted.

(Second Programming) (S153 to S158)

In programming by the pass write method, a memory cell into which data“1” is to be written has not been written into at all. For this reason,the memory cell is written into roughly as described above. Whenprogramming is not done by the pass write method, the second programmingmay be omitted.

In the second programming, data “0” is stored into the flag data storagecircuit 10 b (S153).

(Internal Data Read 2 and Data Cache Setting 2) (S154, S155)

Before the memory cells are written into, the potential of the word lineis set to “a” and an internal read operation is carried out to determinewhether the data in the memory cell of the second page is “0” or is “2”,“4”, or “6” (S154). Thereafter, by manipulating the data caches, thedata caches are set as shown in FIG. 40A (S155).

Specifically, when the data in the memory cell is made “1”, the PDC isset low. When the data in the memory cell is set to a value other than“1”, the PDC is set high.

In this state, a program operation is carried out (S156).

(Third Page Verify: Verifies Data “1”) (S157)

The operation of verifying data “1” is identical with the operation ofverifying data “5” in writing the third page and data “2” in writing thesecond page (data “1” in writing the second page in the first to seventhembodiments). Here, the verify potential is “a*′” (S157).

When the PDC is low, the write operation is carried out again and theprogram operation and the verify operation are repeated until the datain the PDCs of all of the data storage circuits have become high (S158).

(Third Programming)

Finally, data “1”, “2”, and “3” are written into the memory cell asfollows.

(Internal Data Read 3 and Data Cache Setting 3) (S159, S160)

First, before the memory cells are written into, the potential of theword line is set to “d*” and an internal read operation is carried outto determine whether the data in the memory cell of the second page is“0” or “2” or is “4” or “6” (S159).

Thereafter, by manipulating the data caches, the data caches are set asshown in FIG. 40B (S160). Specifically, when the data in the memory cellis made “0”, the PDC is set high, the DDC is set low, and the SDC is sethigh. When the data in the memory cell is made “1”, the PDC is set low,the DDC is set high, the SDC is set high. When data in the memory cellis made “2”, the PDC is set low, the DDC is set high, and the SDC is setlow. When the data in the memory cell is made “3”, the PDC is set low,the DDC is set low, and the SDC is set low. When the data in the memorycell is set to “4” to “7”, all of the PDCs are set high.

(Third Page Verify: Verifies Memory Cell Data “1”) (S161)

In programming by the pass write method, a memory cell into which data“1” is to be written has been written into in the second programminguntil the verify potential “a*′” lower than the original verifypotential “a′” has been reached. Therefore, there may be cells whoseverify potential has reached the original verify potential “a′”. Forthis reason, data “1” is first verified. The operation of verifying data“1” is identical with the operation of verifying data “5” in writing thethird page and data “2” in writing the second page (data “1” in writingthe second page in the first to seventh embodiments). Here, the verifypotential is “a′”.

(Third Page Verify: Verifies Memory Cell Data “2”) (S162)

In a memory cell into which data “2” is to be written, the second pageis written until the verify potential “b*′” lower than the originalverify potential “b′” has been reached. Thereafter, the thresholdvoltage may have risen as a result of writing the adjacent cells. Inaddition, there may be cells whose verify potential has reached theoriginal verify potential “b′”. For this reason, data “2” is firstverified.

The operation of verifying data “2” is identical with the operation ofverifying data “6” in writing the third page and the operation ofverifying data “2” in writing the second page (data “1” in writing thesecond page in the first to seventh embodiments). Here, the verifypotential is “b′”.

(Program Operation) (S163)

The program operation is identical with the first and second programoperations for the first, second, and third pages. When data “1” hasbeen stored in the PDC, the memory cell is not written into. When data“0” has been stored in the PDC, the memory cell is written into.

Thereafter, the verify potentials “a′” and “b′” are set in that orderand data “1” and data “2” are verified (S164, S165). At the same time,data “3” is verified as described below.

(Third Page Verify: Verifies Data “3”) (166)

The operation of verifying data “3” is identical with the operation ofverifying data “7” in writing the third page and he operation ofverifying data “6” in writing the second page (data “3” in writing thesecond page in the first to seventh embodiments). Here, the verifypotential is “c′”.

When the PDC is low, the write operation is carried out again and theprogram operation and verify operations are repeated until the data inthe PDCs of all the data storage circuits have become high (S167).

In the above explanation, after one programming is completed, fourverify operations are carried out. In the initial loop of theprogramming, since the threshold voltage does not rise, the operationsof verifying data “3” and of verifying data “3” and data “2” may beomitted.

Furthermore, in a loop close to the end of the programming, data “1” hasbeen written or data “2” and data “1” have been written. Therefore, theverify operations for them may be omitted. If the operation of verifyingdata “1” is not needed, it is not necessary for the SDC to store thedata. Therefore, the data for next writing may be read from the outsideworld and stored in the SDC. This configuration enables a muchhigher-speed operation.

Furthermore, on the second pages, data is written into the flag cellFC1. Only on the third page, data is written into the flag cell FC2.

(First Page Read)

FIG. 41A is a flowchart for the operation of reading the first page.

First, an address is specified to select three pages shown in FIG. 34.As shown in FIGS. 35A to 35C and FIGS. 36A and 36B, the distribution ofthe threshold voltage has changed before and after the writing of thesecond page and before and after the writing of the third page.Therefore, after the potential of the word line is set to “a”, a readoperation is carried out and it is determined whether the flag cell hasbeen written into (S171, S172). In this determination, if more than oneflag cell is used, the determination is made by a majority decision.

When both of the data items read from the flag cells FC1, FC2 are “1”(or none of the flag cells FC1, FC2 have been written into), the writingof the second and third pages has not been carried out. As a result, thedistribution of the threshold voltage of the cell is as shown in FIG.35A or 35B. To determine the data in such cells, a read operation has tobe carried out with the potential of the word line at “a”. The result ofthe read operation with the word line potential “a” has been alreadyread into the data storage circuit. Therefore, the data stored in thedata storage circuit is outputted (S173).

When the data in the flag cell FC1 is “0” and the data in the flag cellFC2 is “1” (or when the flag cell FC1 has been written into and the flagcell FC2 has not been written into), the data has been written into thesecond page and the data has not been written into the third page. As aresult, the cell threshold voltage distribution is as shown in FIG. 35Cor FIG. 36A. To determine the data on the first page of such cells, aread operation has only to be carried out with the potential of the wordline at “d*”. After the read operation is carried out with the word linepotential “d*”, the data is outputted (S174, S175, S173).

When both of the data items in the flag cells FC1, FC2 are “0” (or bothof the flag cells FC1, FC2 have been written into), the data has beenwritten into the second and third pages. Therefore, the cell thresholdvoltage distribution is as shown in FIG. 36B. To determine the data onthe first page of such cells, the potential of the word line is set to“d” and a read operation is carried out. Then, the data read in the readoperation is outputted (S172, S174, S176, S173).

(Second Page Read)

FIG. 41B is a flowchart for the operation of reading the second page. Inreading the second page, an address is first specified to select threepages shown in FIG. 34. Thereafter, the potential of the word line isset to “a” and a read operation is carried out (S181). Then, it isdetermined whether data has been written into the flag cells FC1, FC2(S182). In the determination, if more than one flag cell is used, thedetermination is made by a majority decision.

When both of the data items read from the flag cells FC1, FC2 are “1”(or none of the flag cells FC1, FC2 have been written into), the datahas not been written into the second and third pages. Therefore, theoutput data is fixed to “1” (S183).

When the data in the flag cell FC1 is “0” and the data in the flag cellFC2 is “1” (or when the flag cell FC1 has been written into and the flagcell FC2 has not been written into), the data has been written into thesecond page and the data has not been written into the third page. As aresult, the cell threshold voltage distribution is as shown in FIG. 35Cor FIG. 36A. To determine the data on the first page of such cells, aread operation is carried out with the potential of the word line at “a”and at “f*”. The result of reading with the word line potential “a” hasbeen already loaded into the data storage circuit. Therefore, after aread operation is carried out with the word line potential set to “f*”,the read-out data is outputted (S185, S186).

When both of the data items in the flag cells FC1, FC2 are “0” (or bothof the flag cells FC1, FC2 have been written into), the data has beenwritten into the second and third pages. Therefore, the memory cellthreshold voltage distribution is as shown in FIG. 36B. To determine thedata on the first page of such cells, the potential of the word line isset to “b” and “f” and a read operation is carried out. That is, after aread operation is carried out, with the potential of the word line beingset to “b”, a read operation is carried out, with the potential of theword line being set to “f”. Then, the read-out data is outputted (S187,S188, S186).

(Third Page Read)

FIG. 42 is a flowchart for the operation of reading the third page. Inthis case, too, an address is first specified to select three pagesshown in FIG. 34. The distribution of the threshold voltage has changedbefore and after the writing of the third page. Therefore, after thepotential of the word line is set to “a”, a read operation is carriedout and it is determined whether data has been written into the flagcells FC1 and FC2 (S191, S192).

When both of the data items in the flag cells FC1, FC2 are “1” (or datahas been written into none of the flag cells FC1, FC2), the third pagehas not been written into. Therefore, the output data is fixed to “1”(S193)

When the data in the flag cell FC1 is “0” and the data in the flag cellFC2 is “1” (or when data has been written into the flag cell FC1 and nodata has been written into the flag cell FC2), the data has not beenwritten into the third page. Therefore, the output data is fixed to “1”(S194, S193).

When both of the data items in the flag cells FC1, FC2 are “0” (or datahas been written into both of the flag cells FC1, FC2), the data hasbeen written into the second and third pages. Therefore, the memory cellthreshold voltage distribution is as shown in FIG. 36B. To determine thedata on the first page of such memory cells, the potential of the wordline is set to “a”, “c”, “e”, and “g” and a read operation is carriedout. The result of reading with the word line potential “a” has beenalready loaded into the data storage circuit. Therefore, the potentialof the word line is set to “c”, “e”, and “g” in that order and a readoperation is carried out. Then, the read-out data is outputted (S195,S196, S197, S198).

(Erase)

Since an erase operation is the same as in the first to seventhembodiments, its explanation will be omitted.

According to the eighth embodiment, it is possible to write and readeight-valued (3-bit) data reliably at a high speed.

With the eight-valued (3-bit) NAND flash memory of the eighthembodiment, in writing the third page, data “4” to data “7” are writtenin the first writing, data “1” is written roughly in the second writing,and data “1” to data “3” are written in the third writing. However, thepresent invention is not limited to this. For instance, data “2”, “4”,and “6” may be written. first and then data “1”, “3”, “5”, and “7” bewritten.

This way of writing also produces the same effect as that of the eighthembodiment.

(Ninth Embodiment)

In the sixth embodiment, when the DDC has data “1” in it in FIG. 27A, anintermediate potential is supplied to the bit line. When the PDC hasdata “0” in it, the bit line is discharged to Vss. In contrast, a ninthembodiment of the present invention eliminates that operation in writinga second page. The write sequence in the ninth embodiment is the same asthat in the flowchart shown in FIG. 28. The operation of the data cacheis as shown in FIG. 43A to FIG. 46.

(a) First, externally inputted data is loaded into the SDC and the dataread in an internal data read is stored into the PDC. FIG. 43A shows therelationship between the data in the SDC and PDC and the data in thememory cell after a data load and an internal read. The PDC representsthe data in a lower page (a first page) and the SDC represents the datain an upper page (a second page).

(b) Thereafter, operations as shown in FIGS. 11 and 12 are carried out,thereby setting the data cache (FIG. 43B). In the case of the data cachesetting as shown in FIG. 27A, to write data “1” into a memory cell, data“1” has been set in the DDC. In contrast, to write data “1” into amemory cell in the ninth embodiment, data “0” is set in the DDC.

Then, the data is written into the memory cell. First, if BLC1=Vsg, whenthe PDC has data “0” in it, the bit line is at Vss, whereas when the PDChas data “1” in it, the bit line is at Vdd. Next, let BLC1=VSS, and thenlet VREG=Vdd and REG=intermediate potential+Vth (1V+Vth). Then, when theDDC has data “1” in it, the bit line is at Vdd. When the DDC has data“0” in it, the bit line is not precharged. As a result, only when data“1” or “3” has been written into the memory cell, the bit line is atVss. When data “2” has been written into the memory cell), the bit lineis at the intermediate potential (1 V). When the data in the memory cellis “0” (or when no data has been written into the memory cell), the bitline is at Vdd. Here, if the selected word line is Vpgm and theunselected word line is Vpass, when the bit line is at Vdd, no writingis done. When the bit line is at Vss, writing is done. When the bit lineis at the intermediate potential (1 V), writing is done a little.Accordingly, a memory cell into which data “2” has been written may notbe written into heavily.

However, as shown in FIG. 47A, before the second page is written, amemory cell into which data “2” is to be written has been written intoup to a rather high threshold level before being written into. For thisreason, writing may be done slowly. In addition, as the Vpgm rises, thememory cell is written into.

(c) Thereafter, a verify voltage “a*′” is set and a write verifyoperation is carried out. In the verify operation, with BLC2being set tothe high level and a specific potential being applied to BLCLAMP, onlywhen the SDC has data “1” in it (that is, data “1” has been written intothe memory cell), the bit line is precharged. When the SDC has data “0”in it, the bit line is not precharged and remains at Vss.

FIG. 44A shows the data cache after a verify operation is carried out atthe verify voltage “a*′”.

Next, the potential of the word line is set to the verify potential“a*′” and the bit line is discharged. Let VPRE=Vdd and BLPRE=Vsg. Then,after the TDC is charged to Vdd, a specific voltage is applied toBLCLAMP. If the bit line is at Vss, the TDC is at Vss. If the prechargepotential is left on the bit line, the TDC is at Vdd. It is when thememory cell into which data “1” has been written reaches the verifypotential “a*′” that the TDC goes to Vdd. When data “1” has not beenwritten into the memory cell, the bit line has not been precharged, withthe result that the TDC is at Vss. In addition, when the memory cellinto which data “1” has been written does not reach the verify potential“a*”, the TDC is at Vss.

Here, if VREG=high level and REG=high level, when the DDC has data “1”in it, the TDC is forced to go to the high level. Therefore, it is whenthe memory cell into which data “1” has been written reaches the verifypotential “a*′” or when the data in the DDC is “1” or data “2” has beenwritten into the memory cell that the TDC goes to Vdd. Let DTG=Vsg andthe data in PDC is copied into the DDC. Thereafter, let BLC1=Vsg and thepotential of the TDC is loaded into the PDC.

In FIG. 44B, it is when the memory cell into which data “1” has beenwritten exceeds the verify potential “2*′” or data “2” has been writtenin the memory cell that the PDC has data “1” in it.

(d) Next, the potential of the word line is dropped a little to producea verify potential “a′” and the bit line is discharged. Let VPRE=Vdd andBLPRE=Vsg. Then, after the TDC is charged to Vdd again, a specificvoltage is applied to BLCLAMP. If the bit line is at Vss, the TDC is atVss. When the precharge potential is left on the bit line, the TDC is atVdd. It is when the memory cell into which data “1” has been writtenreaches the verify potential “a′” that the TDC goes to Vdd. When data“1” has not been written into the memory cell, the bit line has not beenprecharged, with the result that the TDC is at Vss. In addition, whenthe memory cell into which data “1” has been written does not reach theverify potential “a′”, the TDC is also at Vss.

Here, let VREG=high level and REG=high level. In this state, when thedata in the DDC is “1”, that is, when no data has been written into thememory cell, the TDC is forced to be set at the high level. Therefore,it is when writing is not selected or when the memory cell into whichdata “1” has been written reaches the verify potential “a′” that the TDCgoes to Vdd.

Next, let DTG=Vsg. Then, after the data in the PDC is copied into theDDC, let BLC1=Vsg. Then, the potential in the TDC is loaded into the PDC(FIG. 45A).

In a memory cell into which data “1” has been written, when thethreshold voltage rises above the verify potential “a*′”, the data inthe DDC becomes “1”. In addition, in a memory cell into which data “1”has been written, all of the write operation using the verify potential“a′” has been completed, the data in the PDC becomes “1”.

(e) A verify operation using a verify potential “b” (FIG. 45B). As inthe first embodiment, in the verify operation, let REG=high level. Then,a specific potential is supplied to BLCLAMP. In this state, in a casewhere the DDC has data “1” in it, that is, in a case where data “2” hasbeen written into the memory cell, or only in a case where data “1” hasbeen written into the memory cell and the threshold voltage is higherthan the verify potential “a*′”. the bit line is precharged. Moreover,in a case where the DDC has data “0” in it, the bit line is notprecharged and remains at Vss.

Next, a verify potential “b” is supplied to the word line and the bitline is discharged. While the bit line is being discharged, the data inthe DDC is transferred to the TDC. Thereafter, the data in the PDC istransferred to the DDC and the data in TDC is transferred to the PDC.Next, after the TDC is charged to Vdd, a specific potential is suppliedto BLCLAMP. Then, it is only when data “2” has been written into thememory cell and the threshold voltage reaches the verify potential “b′”that the TDC goes high.

Here, let VREG=high level and REG=Vsg. In this state, when the data inthe DDC is at the high level, the TDC is forced to go high. Therefore,it is when data “2” has been written into the memory cell and the verifypotential “b′” is reached or when writing is not selected that the TDCgoes to Vdd. Let DTG=Vsg. Then, after the data in the PDC is copied intothe DDC, let BLC1=Vsg. Then, the potential in the TDC is loaded into thePDC.

(f) A verify operation using a verify potential “c” (FIG. 46). As in thefirst embodiment, in this verify operation, too, let BLPRE=high level.Then, a specific potential is supplied to BLCLAMP and the bit line isprecharged.

Next, the verify potential “c′” is supplied to the word line and the bitline is discharged. While the bit line is being discharged, the data inthe DDC is transferred to the TDC. Thereafter, the data in the PDC istransferred to the DDC and the data in the TDC is transferred to thePDC.

Then, after the TDC is charged to Vdd, a specific potential is suppliedto BLCLAMP. It is only when the threshold voltage reaches the verifypotential “c′” that the TDC goes high. Then, let VREG=high level andREG=Vsg. In this state, when the data in the DDC is at the high level,the TDC is forced to go high. Therefore, it is when data “3” has beenwritten into the memory cell and the verify potential “c′” is reached orwhen writing is not selected that the TDC goes to Vdd.

Next, let DTG=Vsg. Then, the data in the PDC is copied into the DDC.Thereafter, let BLC1=Vsg. Then, the potential in the TDC is loaded intothe PDC.

In this way, the program and verify operations are repeated until thedata in all of PDCs become “1”. However, in a write operation, when thedata in the DDC is “1”, that is, when data “2” has been written into thememory cell, or when data “1” has been written into the memory cell andthe verify potential “a*′” has been exceeded, the bit line is set to theintermediate potential and writing is done. Each time the program andverify operations are repeated, Vpgm is raised little by little.

With the ninth embodiment, in the second page write operation, when theDDC has data “1” in it after the data cache is set, or when the bit lineis precharged to Vdd in verifying data “2” in the memory cell and theDDC has data “0” in it, the bit line is not precharged. As a result, thebit line goes to Vss only when data “1” has been written into the memorycell and the verify level “a*′” is not exceeded, or when data “3” hasbeen written into the memory cell. The bit line goes to the intermediatepotential (1 V) when data “1” has been written into the memory cell andthe verify level “a*′” is exceeded, or when data “2” has been writteninto the memory cell. The bit line goes to Vdd when the data in thememory cell is “0”. Thus, if the selected word line is Vpgm and theunselected word line is Vpass, when the bit line is Vdd, no writing isdone. Furthermore, the bit line is at Vss, writing is done. Moreover,when the bit line is at the intermediate potential (1 V), writing isdone a little, which raises the threshold voltage of the memory cell alittle. Accordingly, when the DDC has data “1” in it, the bit line goesto the intermediate potential during programming, which decreases thewrite speed. This makes it possible to set the distribution of thresholdvoltages accurately.

In the ninth embodiment, when the data in the first page (lower page) iswritten into the memory cells and then the data in the second page(upper page) is written into the memory cell, the data in the first pageis read and three levels of threshold voltages are written. However, thedata in the first page and the data in the second page may be writteninto the memory cells at the same time.

Specifically, as shown in FIG. 48, the data in the first page is loadedinto the SDC (S201). Then, the data in the first page is transferredfrom the SDC to the PDC (S202). Next, the data in the second page isloaded into the SDC (S203). Thereafter, the data cache is set as shownin FIG. 43B (S134). According to the data in the data cache, the programis executed (S135). In FIG. 48, since the operations subsequent to theprogram are the same as those in FIG. 28, the same parts are indicatedby the same reference numerals and explanation of them will be omitted.

With the above method, since the data in the first page and the data inthe second page are written into the memory cells at the same time, thedata in the first page need not be read by the write operation andinternal data read operation only for the first page. As a result,high-speed writing can be done.

(Tenth Embodiment)

FIG. 49, which shows a modification of FIG. 7, shows the order in whicha plurality of adjacent memory cells are written into.

In a tenth embodiment of the present invention, a plurality of memorycells in a block are written into in pages, starting with the memorycells closer to a source line. In FIG. 49, only four word lines areshown to simplify the explanation.

In a first write operation, one bit of data is written into a first pageof memory cell 1.

In a second write operation, one bit of data is written into a firstpage of memory cell 2 adjacent to memory cell 1 in the word direction.

In a third write operation, one bit of data is written into a secondpage of memory cell 1.

In a fourth write operation, one bit of data is written into a secondpage of memory cell 2 adjacent to memory cell 1 in the word direction.

In a fifth write operation, one bit of data is written into a first pageof memory cell 3 adjacent to memory cell 1 in the bit direction.

In a sixth write operation, one bit of data is written into a first pageof memory cell 4 diagonally adjacent to memory cell 1.

In a seventh write operation, one bit of data is written into a secondpage of memory cell 3.

In an eighth write operation, one bit of data is written into a secondpage of memory cell 4 adjacent to memory cell 3 in the word direction.

In a ninth write operation, one bit of data is written into a first pageof memory cell 5 adjacent to memory cell 3 in the bit direction.

In a tenth write operation, one bit of data is written into a first pageof memory cell 6 diagonally adjacent to memory cell 3.

In an eleventh write operation, one bit of data is written into a secondpage of memory cell 5.

In a twelfth write operation, one bit of data is written into a secondpage of memory cell 6 adjacent to memory cell 5 in the word direction.

In a thirteenth write operation, one bit of data is written into a firstpage of memory cell 7 adjacent to memory cell 5 in the bit direction.

In a fourteenth write operation, one bit of data is written into a firstpage of memory cell 8 diagonally adjacent to memory cell 5.

In a fifteenth write operation, one bit of data is written into a secondpage of memory cell 7.

In a sixteenth write operation, one bit of data is written into a secondpage of memory cell 8 adjacent to memory cell 7 in the word direction.

Even in the above write sequence, the same effect as shown in theexample of FIG. 7 can be obtained.

(Eleventh Embodiment)

FIG. 50 shows the relationship between a memory cell array 1 and a bitline control circuit 2, which are applied to an eleventh embodiment ofthe present invention. FIG. 51 shows a data storage circuit 10 appliedto the eleventh embodiment.

In each of the above embodiments, one data storage circuit 10 has beenconnected to a pair of bit lines BLe, BLo as shown in FIGS. 3 and 6. Inthe eleventh embodiment, however, one data storage circuit 10 isconnected to each bit line as shown in FIGS. 50 and 51. In addition, aplurality of memory cells is selected simultaneously with, for example,one flag cell FC. The bit line BLF1 to which the flag cell is connectedis connected to a flag data storage circuit 10 a.

Furthermore, in each of the above embodiments, of the memory cellsconnected to a single word line, half of the memory cells have beencapable of being written into or read from simultaneously as shown inFIG. 3. In the eleventh embodiment, however, data storage circuits 10,10 a are connected to the bit lines in a one-to-one correspondence. Thisenables all of the memory cells and flag cell connected to a single wordline to be written into or read from simultaneously. Specifically, inFIG. 3, the second page has been composed of half of the memory cellsselected simultaneously by the word line. In the eleventh embodiment,however, the second page is composed of all of the memory cells selectedsimultaneously by the word line.

In FIG. 51, the transistors 61 m, 61 n to which signals CHK1, CHK2 shownin FIG. 6 are supplied are omitted.

FIG. 52 shows the write sequence in the eleventh embodiment. In a block,a NAND cell is written into in such a manner that the memory cellscloser to the source line are written into page by page. To simplify theexplanation, only four word lines are shown in FIG. 52.

In a first write operation, one bit of data is written into a first pageof memory cell 1.

In a second write operation, one bit of data is written into a secondpage of memory cell 1. At this time, data is written into also the flagcell.

In a third write operation, one bit of data is written into a first pageof memory cell 2 adjacent to memory cell 1 in the bit line direction.

In a fourth write operation, one bit of data is written into a secondpage of memory cell 2. At this time, data is written into also the flagcell.

In a fifth write operation, one bit of data is written into a first pageof memory cell 3 adjacent to memory cell 2 in the bit direction.

In a sixth write operation, one bit of data is written into a secondpage of memory cell 3. At this time, data is written into also the flagcell.

In a seventh write operation, one bit of data is written into a firstpage of memory cell 4 adjacent to memory cell 3 in the bit linedirection.

In an eighth write operation, one bit of data is written into a secondpage of memory cell 4. At this time, data is written into also the flagcell.

In the eleventh embodiment, the data storage circuits 10 are connectedto the bit lines in a one-to-one correspondence. As a result, it ispossible to write or read data into or from all of the memory cellsselected simultaneously by the word line.

In addition, after the data on the first page and second page arewritten into all of the memory cells simultaneously selected by the wordline, the data is written sequentially into the memory cells separatefrom the source line. Therefore, as compared with a case where data iswritten into the memory cells connected to a word line in units of halfof the memory cells as in each of the above embodiments, the eleventhembodiment has the advantage of being less influenced by variations inthe threshold voltages of the memory cells adjoining in the word linedirection.

Furthermore, when one data storage circuit 10 is connected to a pair ofbit lines as shown in FIG. 6, transistors 61 x, 61 y for supplying aspecific potential BLCRL to the unselected bit lines are needed.Moreover, transistors 61 v, 61 w are connected to the individual bitlines. These transistors 61 x, 61 y, 61 v, 61 w are highbreakdown-voltage transistors and have larger sizes than the transistorsconstituting the data storage circuit. As described above, in the caseof the circuit configuration of FIG. 6, two large-sized transistors areconnected to one bit line. In contrast, in the case of the circuitconfiguration of FIG. 51, the data storage circuit has no unselected bitline. As a result, only one high breakdown-voltage transistor 61 v isconnected to each bit line. Therefore, the circuit size can be reduced.

(Modification)

The write sequence shown in FIG. 53 is a modification of the writesequence shown in FIG. 52. In the write sequence of FIG. 52, after thedata on the first and second pages are written into the memory cellsselected simultaneously by the word line, the data is writtensequentially into the memory cells separate from the source line. Incontrast, in the case of the example of FIG. 53, after the data on thefirst page is written into two memory cells adjoining in the bit linedirection, the data on the second page is written into the memory cellsclose to the source line. Specifically, the data is written into thememory cells as follows.

In a first write operation, one bit of data is written into a first pageof memory cell 1.

In a second write operation, one bit of data is written into a firstpage of memory cell 2 adjacent to memory cell 1 in the bit linedirection.

In a third write operation, one bit of data is written into a secondpage of memory cell 1.

In a fourth write operation, one bit of data is written into a firstpage of memory cell 3 adjacent to memory cell 2 in the bit linedirection.

In a fifth write operation, one bit of data is written into a secondpage of memory cell 2.

In a sixth write operation, one bit of data is written into a first pageof memory cell 4 adjacent to memory cell 3 in the bit line direction.

In a seventh write operation, one bit of data is written into a secondpage of memory cell 3.

In an eighth write operation, one bit of data is written into a secondpage of memory cell 4.

In the above writing method, after the data on the first page is writteninto the memory cells adjoining in the bit line direction, the data onthe second page is written into the memory cells close to the sourceline and then the data on the first page is written into the memorycells opposite and adjacent to the source line. As a result, the effectof the coupling of the word line can be reduced, which enables thedistribution of the threshold voltages of the memory cells to benarrowed.

FIG. 54 shows a modification of the circuit shown in FIG. 50. In thecircuit of FIG. 50, a data storage circuit 10 is provided at one end ofeach bit line. On the other hand, a data storage circuit 10 is providedalternately at one end or the other end of an adjacent bit line. In thiscase, the write operation is the same as in the eleventh embodiment. Asdescribed above, since a data storage circuit 10 is provided alternatelyat one end or the other end of an adjacent bit line, this makes thelayout of the data storage circuits 10 easier.

FIGS. 55 and 56 show the write sequence in setting an octal thresholdvalue in a cell and storing 3 bits.

The write sequence shown in FIG. 55 is as follows.

In a first write operation, one bit of data is written into a first pageof memory cell 1.

In a second write operation, one bit of data is written into a secondpage of memory cell 1.

In a third write operation, one bit of data is written into a third pageof memory cell 1.

In a fourth write operation, one bit of data is written into a firstpage of memory cell 2 adjacent to memory cell 1 in the bit linedirection.

In a fifth write operation, one bit of data is written into a secondpage of memory cell 2.

In a sixth write operation, one bit of data is written into a third pageof memory cell 2.

In a seventh write operation, one bit of data is written into a firstpage of memory cell 3 adjacent to memory cell 2 in the bit linedirection.

In an eighth write operation, one bit of data is written into a secondpage of memory cell 3.

In a ninth write operation, one bit data is written into a third page ofmemory cell 3.

In a tenth write operation, one bit of data is written into a first pageof memory cell 4 adjacent to memory cell 3 in the bit line.

In an eleventh write operation, one bit of data is written into a secondpage of memory cell 4.

In a twelfth write operation, one bit of data is written into a thirdpage of memory cell 4.

The write sequence shown in FIG. 56 is as follows.

In a first write operation, one bit of data is written into a first pageof memory cell 1.

In a second write operation, one bit of data is written into a firstpage of memory cell 2 adjacent to memory cell 1 in the bit linedirection.

In a third write operation, one bit of data is written into a secondpage of memory cell 1.

In a fourth write operation, one bit of data is written into a firstpage of memory cell 3 adjacent to memory cell 2 in the bit linedirection.

In a fifth write operation, one bit of data is written into a secondpage of memory cell 2.

In a sixth write operation, one bit of data is written into a third pageof memory cell 1.

In a seventh write operation, one bit of data is written into a firstpage of memory cell 4 adjacent to memory cell 3 in the bit linedirection.

In an eighth write operation, one bit of data is written into a secondpage of memory cell 3.

In a ninth write operation, one bit data is written into a third page ofmemory cell 2.

In a tenth write operation, one bit of data is written into a secondpage of memory cell 4.

In an eleventh write operation, one bit of data is written into a thirdpage of memory cell 3.

In a twelfth write operation, one bit of data is written into a thirdpage of memory cell 4.

(Twelfth Embodiment)

A twelfth embodiment of the present invention is such that, in a dividedwrite operation of dividing one page into areas and writing the datainto the areas, a flag cell is provided so as to correspond to each ofthe divided areas.

In the first to tenth embodiments, in a NAND flash memory, one page ofdata, for example, 2 kilobytes+64 bytes of data, is written in one writeoperation. Depending on an application using a NAND flash memory, onepage may be required to be divided into areas and written into in areas.The way of dividing one page includes, for example, 2 kilobytes and 64kilobytes and 1 kilobytes+32 bytes, 1 kilobytes+32 bytes and 1 kilobytesand 1 kilobytes and 64 bytes.

FIG. 57 schematically shows the relationship between the memory cellarray 1 and the flag cell FC. As shown in FIG. 57, when one page isdivided into, for example, area A and area B, a first flag cell FC1 isprovided so as to correspond to area A and a second flag cell FC2 isprovided so as to correspond to area B.

With the above configuration, when the data is written into area A onthe second page, the data is written into also the first flag cell FC1.When the data is written into area B on the second page, the data iswritten into also the second flag cell FC2.

Furthermore, with the above configuration, when divided writing is notdone, that is, when the data is written into area A and area B on thesecond page at the same time, the data is written into both of the firstand second flag cells FC1, FC2.

FIGS. 58A to 58D show concrete write sequences for area A and area B. Afirst page write operation shown in FIGS. 58A and 58B are the same as ina case where no divided writing is done. In the write operation, no datais written into the flag cells FC1 and FC2.

FIG. 58C shows the operation of writing data into area A on the secondpage. First, data “1” is set in all of the data storage circuits 10(S301).

Thereafter, data for area A is supplied to the data storage circuitcorresponding to area A (S302).

Then, data for the flag cell FC1 corresponding to area A is supplied tothe data storage circuit (S303). Thereafter, the data cache is set(S304) and data is written into area A and area B (S305).

At this time, writing data in area B is set to “1.” Therefore, when thefirst page has been written into and the data in the memory cell is “2,”the data in the memory cell in area B is “3” as shown in FIG. 1C, withthe result that no data can be written into area B. For this reason,when the data in the memory cell is “2” (the threshold voltage is equalto or higher than “b*′”), the data in the memory cell is set to “2” (thethreshold voltage is equal to or higher than “b′”). Specifically, forexample, in a case where data is set in each data cache as shown in FIG.43B, when the data caches are not operated at all, data “3” is writteninto the memory cells. To overcome this problem, for example, the signalPRST supplied to the gate of the transistor 61 d shown in FIG. 6 or FIG.51 is divided into signal PRST for area A and signal PRST for area B.Then, when data has been set in the data cache, the signal PRST is madehigh, thereby resetting the data in area B. This sets the data in theDDC to “1,” thereby writing data “2” into the memory cell. As a result,the data in the memory cell. in area B is “0” or “2.” In addition, nodata is written into the flag cell FC2.

In the state where area A has been written into, a first page readoperation is the same as the-read operation in FIG. 13 or 16. At thistime, the data in area A and the data in area B are both read accordingto the data in the flag cell corresponding to area A. A second page readoperation is the same as the read operation in FIG. 14 or 15. The datain area A is read after a second page write operation. However, when thedata in area B is read, no data has not been written into the flag cellFC2 used to recognize that the data in the second page has been writteninto area B. Thus, the data in area B is forcibly read as “1.”

Next, the operation of writing data into area B on the second page willbe explained by reference to FIG. 58D. First, data “1” is set in all ofthe data storage circuits 10 (S311). Thereafter, data for area B issupplied to the data storage circuit corresponding to area B (S312).Then, data for the flag cell FC2 corresponding to area B is supplied tothe data storage circuit (S313). After this, the data cache is set(S314) and data is written into area B (S315). At this time, when thememory cells in area A have been written into, the memory cells in areaA might have been written into. For this reason, the memory cells inarea A are prevented from being written into. Specifically, for example,when data is set in the cache, the PDC might take the value of “0” asshown in FIG. 43B.

To overcome this problem, the signal PRST supplied to the gate of thetransistor 61 d in FIG. 6 or 51 is divided into signal PRST for area Aand signal PRST for area B. Then, when data is set in the data cache,the signal PRST is made high, thereby resetting the data in area A. Thissets the data in the PDC to “1,” preventing the data from being writteninto the memory cells. As a result, the data in the memory cells in areaA does not change.

In the twelfth embodiment, area A and area B can be controlledindependently according to the data in the first and second flag cellsFC1, FC2. Therefore, even during a divided write operation, a readoperation can be performed on the area into which the data on, forexample, the second page has been written.

In FIG. 57, both of the flag cells FC1 and FC2 are provided at the rightend of the cell array. However, the flag cell FC1 may be provided nextto area A and the flag cell FC2 may be provided next to area B.

In addition, each page may be divided into two or more areas. In thiscase, two or more flag cells are provided so as to correspond to thedivided areas.

The twelfth embodiment can be applied to the configuration of each ofFIGS. 50 and 51. In addition, the pages set in the memory cell are notlimited to two pages and may be set according to the number of bitsstored in the memory cell. Specifically, when a 2^(n) (n is a naturalnumber equal to 2 or more) number of threshold voltages are set in thememory cell, an n number of pages are set. At this time, at the sametime when the n-th page is written into, the data is written into theflag cells.

For example, when 2³ threshold voltages are set in memory cells, threepages are used. At this time, data is written into the first flag cellat the same time when the second page in area A is written into. Data iswritten into the second flag cell at the same time when the second pagein area B is written into. Data is written into the third flag cell atthe same time when the third page in area A is written into. Data iswritten into the fourth flag cell at the same time when the third pagein area B is written into.

Furthermore, a plurality of threshold voltages may be set also in theflag cells. In this case, data is written into the first flag cell atthe same time when the second page in area A is written into. Data iswritten into the second flag cell at the same time when the second pagein area B is written into. Data is written into the first flag cell atthe same time when the third page in area A is written into. Data iswritten into the second flag cell at the same time when the second pagein area B is written into. As described above, setting a plurality ofthreshold voltages also in the flag cells enables an increase in thenumber of flag cells to be suppressed even when the number of pagesincreases.

(Thirteenth Embodiment)

A thirteenth embodiment of the present invention is modified from thesecond embodiment. As shown in FIG. 60A, in the second embodiment, whena second page is written into, the data in a memory cell is changed from“0” to “1” or from “2” to “3.” At the same time, the data in the flagcell is changed from “0” to “2” as shown in FIG. 60B. When writing isdone in this way, the threshold voltage distribution in the flag cellmight widen as shown in FIG. 60B. The threshold voltage is higher thanthe word line potential in a read operation. In this state, when thesecond page is read from as shown in FIG. 14, the data read from theflag cell is “1,” which means that the second page has not been writteninto.

To overcome this problem, in the thirteenth embodiment, a first flagcell FC1 and a second flag cell FC2 are provided as shown in FIG. 34. Inthis configuration, when the second page is written into, the data inthe first flag cell FC1 is changed from “0” to “2” and the data in thesecond flag cell is changed from “0” to “1” as in the second embodiment.

FIG. 61A shows the threshold voltage distribution in he first flag cellFC1 after the second page is written into. FIG. 61B shows the thresholdvoltage distribution in the second flag cell FC2.

In a data read operation, when the data in the first page is read, it isdetermined from the data in the first flag cell FC1 whether the secondpage has been written into, as shown in FIG. 62. Specifically, first, ina read operation, the potential on the word line is set to “b” and thenthe data is read from the memory cell and the first flag cell FC1. Ifthe data in the first flag cell FC1 is “0,” it is found that the secondpage has been written into. If the data in the first flag cell FC1 is“1,” it is found that the second page has not been written into.Therefore, the potential on the word line is set to “a” and then thedata in the memory cell is read out.

When the data in the second page is read, it is determined from the datain the second flag cell FC2 whether the second page has been writteninto, as shown in FIG. 63. Specifically, first, the potential on theword line is set to “c” and the data is read. Then, the potential on theword line is set to “a” and the data is read. If the data in the secondflag cell FC2 is “0,” this means that the second page has been writteninto. Therefore, the read-out data is outputted. On the other hand, ifthe data in the second flag cell FC2 is “1,” this means that the secondpage has not been written into. Therefore, data “1” is outputted.

In the thirteenth embodiment, the first and second flag cells FC1, FC2are provided. According to the data in the first and second flag cellsFC1, FC2, it is determined whether the second page has been writteninto. Therefore, in the operation of writing data into the second page,even when the threshold voltage distribution in each of the first andsecond flag cells FC1, FC2 widens, it can be determined reliably whetherthe second page has been written into in reading the data.

In the thirteenth embodiment, the data in the first flag cell FC1 hasbeen changed from “0” to “2.” However, the data may be changed from “0”to “3.” In addition, the data in the second flag cell FC2 has beenchanged from “0” to “1.” However, the data may be changed from “0” to“2.” With this configuration, a large margin for the threshold voltagedistribution and the potential on the word line in a read operation canbe allowed for. Consequently, it is possible to increase the reliabilityof data retention.

FIG. 64 is a modification of the thirteenth embodiment. In themodification, to increase the reliability further, a plurality of firstand second flag cells and dummy cells are provided at one end of thememory cell array. Specifically, three first flag cells and three secondflag cells are provided for even-numbered pages (BLE). Three first flagcells and three second flag cells are provided for odd-numbered pages(BLO). In this configuration, when the data is read, a decision bymajority is made using the three first flag cells on an even-numberedpage and a decision by majority is made using the three second flagcells on the even-numbered page, thereby determining whether the secondpage has been written into on the even-numbered page. Furthermore, adecision by majority is made using the three first flag cells on anodd-numbered page and a decision by majority is made using the threesecond flag cells on the odd-numbered page, thereby determining whetherthe second page has been written into on the odd-numbered page. Withthis configuration, even when the threshold voltage in a cell writteninto earlier is changed by the threshold voltage in an adjacent cellwritten into later through the FG-FG capacitance of the adjacent cells,it can be determined reliably whether the second page has been writteninto.

Additional advantages and modifications will readily occur to thoseskilled in the art. Therefore, the invention in its broader aspects isnot limited to the specific details, representative embodiments shownand described herein. Accordingly, various modifications may be madewithout departing from the spirit or scope of the general inventiveconcept as defined by the appended claims and their equivalents.

1. A semiconductor memory device comprising: a memory cell arrayconfigured by arranging a plurality of memory cells in a matrix, eachof, which is capable of having one of four threshold voltages andstoring two bits of data; a plurality of bit lines, each of which isconnected to said plurality of memory cells arranged in the columndirection; a plurality of word lines, each of which is connected to saidplurality of memory cells arranged in the row direction; a first flagcell and a second flag cell which are selected at the same time when thememory cells are selected by each of the word lines; and a controlsection which, when writing the data in a second page composed of thetwo bits into the memory cells selected by the word line, writesspecific data into the first and second flag cells and which, whenreading the data in a first page from the memory cells, determines fromthe data read from the first flag cell whether the second page has beenwritten into the memory cells and which, when reading the data in thesecond page from the memory cells, determines from the data read fromthe second flag cell whether the second page has been written into thememory cells.
 2. The semiconductor memory device according to claim 1,wherein said plurality of memory cells arranged in the column directionare connected in series to configure a NAND cell.
 3. The semiconductormemory device according to claim 1, wherein the first and the secondflag cells include a plurality of cells, respectively; and the controlsection causes the plurality of cells to store the same logic level in awrite operation and decides the output of the first and the second flagcells by a majority of the outputs of the plurality of cells.
 4. Thedevice according to claim 1, wherein the control section changes thethreshold voltage of the memory cell from a first threshold voltage toone of the first threshold voltage and a second threshold voltage (thefirst threshold voltage<the second threshold voltage) by a first pagewrite operation, and when the threshold voltage of the memory cell isthe first threshold voltage, the control section changes the thresholdvoltage of the memory cell to one of the first threshold voltage and athird threshold voltage (the first threshold voltage<the third thresholdvoltage) by a second page write operation, and when the thresholdvoltage of the memory cell is the second threshold voltage, the controlsection changes the threshold voltage of the memory cell to one of afourth threshold voltage and a fifth threshold voltage (the secondthreshold voltage≦the fourth threshold voltage, the fourth thresholdvoltage<the fifth threshold voltage) by a second page write operation.5. The device according to claim 4, wherein when data is written intothe second page during the second page operation, the control sectionchanges a threshold voltage of the first flag cell from a firstthreshold voltage to the fourth threshold voltage and which changes athreshold voltage of the second flag cell from the first thresholdvoltage to the third threshold voltage.
 6. The device according to claim5, wherein when data is read from the first page, the control sectionreads data in the memory cell by a first read voltage (the thirdthreshold voltage<the first read voltage≦the fourth threshold voltage),and when the threshold voltage of the first flag cell is the firstthreshold voltage, the control section reads the data in the memory cellby the second read voltage (the first threshold voltage<the second readvoltage≦the second threshold voltage).
 7. The device according to claim6, wherein when data is read from the second page, the control sectionreads data in the memory cell by a third read voltage and a fourth readvoltage (the fourth threshold voltage<the third read voltage≦the fifththreshold voltage)(the first threshold voltage<the fourth readvoltage≦the third threshold voltage), and when the threshold voltage ofthe second flag cell is the first threshold voltage, the control sectionchanges the read data of the memory cell to be the same as data obtainedwhen the threshold voltage of the memory cell is the first thresholdvoltage.